]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/infrun.c
Allow debugging of runtime loader / dynamic linker
authorKevin Buettner <kevinb@redhat.com>
Thu, 20 Oct 2022 02:36:07 +0000 (19:36 -0700)
committerKevin Buettner <kevinb@redhat.com>
Thu, 20 Oct 2022 02:40:33 +0000 (19:40 -0700)
commitbe6276e0aed1f2df8f771d9823b6c8fea29e6a66
tree4fe6cbb061a3e3222b057e31b09abd08806671a1
parentb64dc199b01de38858c853c434c278a51fe890cb
Allow debugging of runtime loader / dynamic linker

At present, GDB does not allow for the debugging of the runtime loader
and/or dynamic linker.  Much of the time, this makes sense.  An
application programmer doesn't normally want to see symbol resolution
code when stepping into a function that hasn't been resolved yet.

But someone who wishes to debug the runtime loader / dynamic linker
might place a breakpoint in that code and then wish to debug it
as normal.  At the moment, this is not possible.  Attempting to step
will cause GDB to internally step (and not stop) until code
unrelated to the dynamic linker is reached.

This commit makes a minor change to infrun.c which allows the dynamic
loader / linker to be debugged in the case where a step, next, etc.
is initiated from within that code.

While developing this fix, I tried some approaches which weren't quite
right.  The GDB testusite definitely contains tests which FAIL when
it's done incorrectly.  (At one point, I saw 17 regressions!) This
commit has been tested on x86-64 linux with no regressions.
gdb/infrun.c