This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Breakpoints in dynamically loaded objects
- To: gdb at sourceware dot cygnus dot com
- Subject: Breakpoints in dynamically loaded objects
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Mon, 8 May 2000 15:43:17 +0200
Right now GDB doesn't gracefully handle breakpoints in dynamically
loaded objects.
If I set a breakpoint in a dynamically loaded module (in this case,
dbopen in libdb.so.3 that is dynamically loaded by the libnss_db
module that comes with glibc), and then restart the program I see the
message
Error in re-setting breakpoint 1:
Function "dbopen" not defined.
repeated three times. In a sense it is reasonable that GDB complains
about not being able to set the breakpoint. Since the libdb.so.3
library isn't loaded at this stage, there indeed is no function
"dbopen". The number of times that GDB prints this message is a bit
annoying though (it prints the same message for every symbol file
added, i.e. for every shared library that is loaded).
However, when the shared library where I placed the breakpoint is
finally loaded, the breakpoint isn't re-enabled. Stepping through the
code revealed that in breakpoint_re_set_one(), the breakpoint is
unconditionally disabled if the symbol for the breakpoint couldn't be
found.
Is it reasonable to change breakpoint_re_set_one() such that it leaves
b->enable alone if it is shlib_disabled? In that case, should we
still print the error message?
Mark