This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
debugging demand loaded modules
- From: Vance Shipley <vances at motivity dot ca>
- To: gdb at sources dot redhat dot com
- Date: Tue, 12 Aug 2003 18:13:12 -0400
- Subject: debugging demand loaded modules
- Organization: Motivity Telecom Inc.
Folks,
I've probably chosen the most complicated scenario to have
my fisrt experience with gdb but this is what I am up against.
I have a program which provides me a shell interface and
from this shell I cause a module I have written to be loaded.
That module has a dependency on another dynamically linked
module, which in turn has more dependencies. I need to debug
the module my module is loading.
The first problem I have is that to run the program you call
a small shell script which then calls a loader program which
then calls the main executable. To get around this I have
been running the program and then having gdb "attach" to it.
Now since I can't just set a break point on functions in my
module which because they haven't been loaded yet I modified
so that I have something I can break at just before it runs
the function I want to debug from the other module.
So now here I am with execution stopped and all the modules
loaded (presumambly). I now need to read the symbol tables
in so I want to run "add-symbol-file <libname> <address>".
What address do I give it? I can't seem to figure out how
I learn this address.
I think I should learn more from "info share" however that
always returns "No executable file." which I am suspecting is
because of the fact that I "attached" to the running process.
I'm in way over my head. Anyone care to shine a light in
here for me?
-Vance