This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Newbie asks about .so libraries
- From: Jim Blandy <jimb at redhat dot com>
- To: William Trenker <wdtrenker at yahoo dot ca>
- Cc: gdb at sources dot redhat dot com
- Date: 29 Jan 2003 17:38:40 -0500
- Subject: Re: Newbie asks about .so libraries
- References: <20030129085049.25d160b2.wdtrenker@yahoo.ca>
renee517@yahoo.com writes:
> Here's a basic question. Can gdb/insight debug code from .so files?
>
> I have a library, compiled with debug information, and a main program, also with debug info. If I start gdb with the main program, does gdb automatically dig up the debug info from any .so libraries used by the main program? Can I set breakpoints on the source code in the .so file?
>
> Or do I have to link statically for debugging purposes?
No, GDB doesn't know anything about the shared libraries until they're
loaded. If you set a breakpoint on 'main', and run the program to it,
then GDB will know about the shared libraries, and you'll be able to
set breakpoints on them.