home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!dtix!mimsy!ra!tantalus!eric
- From: eric@tantalus.dell.com (Eric Youngdale)
- Newsgroups: comp.os.linux
- Subject: Re: Shared Libraries Considered Harmful
- Message-ID: <3345@ra.nrl.navy.mil>
- Date: 14 Aug 92 02:31:35 GMT
- References: <1992Aug12.202438.19963@serval.net.wsu.edu> <1992Aug13.124928.13672@crd.ge.com> <1992Aug13.205728.25720@serval.net.wsu.edu>
- Sender: usenet@ra.nrl.navy.mil
- Organization: Naval Research Laboratory
- Lines: 24
-
- 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
- --
- Eric Youngdale
- eric@tantalus.nrl.navy.mil
-