[patch] Fixes problem setting breakpoint in dynamic loader

PAUL GILLIAM pgilliam@us.ibm.com
Thu May 25 02:26:00 GMT 2006


On PowerPC-64, with 64-bit executables, GDB has been giving this message
for a while:

        warning: Unable to find dynamic linker breakpoint function.
        GDB will be unable to debug shared library initializers
        and track explicitly loaded dynamic code.

This is because "enable_break()" in solib-svr4.c was looking for the
symbol "._dl_debug_state" in the 64-bit dynamic loader and not finding
it.  This should not be a surprise because these 'dot' symbols have not
been used for a while.

The reason that the non-'dot' symbol was also passed by, is that it
points into a data section and the existing code only checked code
sections.

If none of the symbols on the list was found in a code section, the
attached patch looks in data sections.  When it finds one, and the data
section is either '.plt' or '.opd', then the address points to a
function descriptor which is then used to find the corresponding code
address where the breakpoint can be set.

OK to commit?

-=# Paul #=-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loader_break.diff
Type: text/x-patch
Size: 4204 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20060525/45d56456/attachment.bin>


More information about the Gdb-patches mailing list