From: eric@tantalus.dell.com (Eric Youngdale) Subject: Re: Shared Libraries Considered Harmful Date: 14 Aug 1992 02:31:35 GMT
In article <1992Aug13.205728.25720@serval.net.wsu.edu> hlu@phys1.physics.wsu.edu (Hongjiu Lu) writes:
>I am not sure if you can run gdb on binaries linked with the shared libs.
>Since gcc 2.2.2, if you compile foo with -g, libg.a will be used instead
>of libc.a.
You can run gdb on executables linked to the shared libs. There are
a couple of limitations, however. If a program crashes within one of the
routines in the shared library, you do not get a meaningful backtrace.
As long as program control is in your program and not the shared library
you can debug fairly normally.
I also found that if I attach a running program that was linked to the
sharable library, that control would often be in the sharable library, and thus
I could not get a meaningful backtrace. It is possible to set breakpoints and
then let it run until it hits the breakpoint, and then you can debug fairly
normally.
Obviously, if you are trying to debug a library routine you ought not
link to the sharable library.
-Eric