Messages in this thread | | | From | "Paul Fulghum" <> | Subject | Re: On Remote debugging ...(gdb) | Date | Sun, 23 May 1999 13:44:55 -0500 |
| |
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/
| |