Extend debugglibc.sh to handle static, static PIE, and container tests?

Gabriel F. T. Gomes gabriel@inconstante.net.br
Tue Nov 26 21:52:00 GMT 2019


On Tue, 26 Nov 2019, Carlos O'Donell wrote:

>I love the new debugglibc.sh script. It really makes my life easier
>when doing certain operations and helping people.

Hurray!

>Any way we can extend this script to support static, and static PIE?
>Detecting either of these means we can just launch the debugger against
>the binary itself without indirecting through the loader which causes
>problems (it doesn't debug properly because loading a static binary
>from ld.so doesn't work).

If I understood it correctly, you would like to be able to use all other
features of the debugglibc.sh script, except for the setup of the
--library-path argument and the loading from ld.so, right?

Regarding libpthread_db, it seems that the auto-loading done for the
shared case is also valid for static.  Is that your understanding, too?

Regarding the fact that debugglibc.sh always adds a breakpoint at
_dl_start_user, that won't work for static.  I wonder if this should be
replaced, for the static case, with some other symbol, e.g.
__libc_start_main, or it if this should simply be removed (specially,
since people can use -b anyway).



More information about the Libc-alpha mailing list