This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Breakpoints in dynamically loaded objects


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]