Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Newbie asks about .so libraries
@ 2003-01-29 16:53 William Trenker
  2003-01-29 17:16 ` Daniel Jacobowitz
  2003-01-29 22:44 ` Jim Blandy
  0 siblings, 2 replies; 4+ messages in thread
From: William Trenker @ 2003-01-29 16:53 UTC (permalink / raw)
  To: gdb

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?

Thanks,
Bill


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie asks about .so libraries
  2003-01-29 16:53 Newbie asks about .so libraries William Trenker
@ 2003-01-29 17:16 ` Daniel Jacobowitz
  2003-01-29 22:03   ` Bennett F. Dill
  2003-01-29 22:44 ` Jim Blandy
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-01-29 17:16 UTC (permalink / raw)
  To: William Trenker; +Cc: gdb

On Wed, Jan 29, 2003 at 08:50:49AM +0000, William Trenker wrote:
> 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?

It should work fine.  There are a couple of quirks, though.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie asks about .so libraries
  2003-01-29 17:16 ` Daniel Jacobowitz
@ 2003-01-29 22:03   ` Bennett F. Dill
  0 siblings, 0 replies; 4+ messages in thread
From: Bennett F. Dill @ 2003-01-29 22:03 UTC (permalink / raw)
  To: William Trenker, gdb

On Wed, Jan 29, 2003 at 12:17:19PM -0500, Daniel Jacobowitz wrote:
> On Wed, Jan 29, 2003 at 08:50:49AM +0000, William Trenker wrote:
> > 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?
> 
> It should work fine.  There are a couple of quirks, though.
> 
> -- 
> Daniel Jacobowitz
> MontaVista Software                         Debian GNU/Linux Developer
In my experience, when I attach to a process that includes say
libc.so.1, gdb says no debugging information found.  I thought maybe I
had to recompile libc.so.1.  Is that not the case?  Maybe/probably I'm
doing something wrong.

Ben


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie asks about .so libraries
  2003-01-29 16:53 Newbie asks about .so libraries William Trenker
  2003-01-29 17:16 ` Daniel Jacobowitz
@ 2003-01-29 22:44 ` Jim Blandy
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Blandy @ 2003-01-29 22:44 UTC (permalink / raw)
  To: William Trenker; +Cc: gdb

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-29 22:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-29 16:53 Newbie asks about .so libraries William Trenker
2003-01-29 17:16 ` Daniel Jacobowitz
2003-01-29 22:03   ` Bennett F. Dill
2003-01-29 22:44 ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox