lkml.org 
[lkml]   [1999]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: On Remote debugging ...(gdb)
Date
What I found is useful is to create a dummy function at
the top of the c source file (so it is 1st in text section).
Then in init_module(), call the dummy function which
returns the address of the dummy function in eax. Follow this
with a hardcoded breakpoint. When the module is loaded
gdb will hit the breakpoint and you can use the add-symbol-file
command with the value in eax.

#define BREAKPOINT() asm(" int $3");

/* add as 1st function in module */
void* get_text_ptr(void);
void* get_text_ptr() {return mgsl_get_text_ptr;}

int init_module(void)
{
/*
* mgsl_get_text_ptr() leaves the .text address in eax
* which can be used with add-symbol-file with gdb.
*/
get_text_ptr();
BREAKPOINT();

/* other init code */
}


Paul Fulghum paulkf@microgate.com
Microgate Corporation www.microgate.com
9501 Capital of Texas Hwy
Austin, Texas 78759
(512)-345-7791

----- Original Message -----
From: Prasanna Gokhale <pras@teil.soft.net>
To: <linux-kernel@vger.rutgers.edu>
Sent: Thursday, May 20, 1999 5:36 AM
Subject: On Remote debugging ...(gdb)


> Hi,
> Iam facing some problem while doing remote debugging.
> Can anybody tell me how to get the start location of the
> dynamically loaded module.
> add-symbol-file driver (address = ????)
> where can i find this address??????
> Thanks in anticipation...
> regards,
> prasanna



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.031 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site