debugging dynamically loaded libraries

debugging dynamically loaded libraries

Post by j.. » Sat, 06 Sep 2003 03:00:53

I'm using Sun Workshop 6.1 on a Solaris 8 machine. I've been through
the dbx manual, but I'm apparently missing something. I've set pathmap
in my .dbxrc, have all the source, object and executable files in the
right place. However, dbx won't break inside a dynamically loaded
library, even when it accepts the breakpoint.

Also, it won't show symbols in a core file for any dynamically loaded
libraries, just hex numbers.

Is there something obvious I'm missing? I'd appreciate a slap upside
the head if I need one.




1. debug dynamically loaded library


I would like to debug a program which dynamically loads a shared library
with dlopen() with dbx and/or the graphical workshop debugger on linux
with gdb.

I have no problem with the basic debugging, but experience the following
problem: when the shared library is not loaded, I cannot set breakpoints
for code in the shared library. This means, I have to set a breakpoint
after the loading call and set the further breakpoints when this
breakpoint is reached.

Any hints how to resolve this problem?

Irix debuggers have a nice feature called pendingtraps which allows to
define breakpoints on not yet loaded modules. Is there something similar
in gdb on Linux?

Or, is there a way to tell gdb to load the dynamically loaded shared
library when starting the program although it's not in the list of
shared libraries in the program?

Furthermore, is there a way to save breakpoints between sessions?

I'm using the following versions of gdb version GNU gdb 19991004

Any help is appreciated.


2. How FAST can Linux boot?

3. debug info wanted for dynamically loaded funct.

4. ports listening

5. Linux PPC and Netscape 4.0.5

6. Welcome to comp.unix.questions [Frequent posting]

7. using gdb with dynamically loaded .so libraries

8. Dynamically Loaded Shared Libraries and dbx

9. Dynamically loading a ****.so library

10. Unresolved references in dynamically loaded shared library (SunOS 4.1.3)

11. Controlling exports in Dynamically loaded shared libraries