diff options
author | Eli Zaretskii <eliz@gnu.org> | 2021-04-10 11:33:08 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-04-10 11:42:54 +0300 |
commit | b3885679dd71bed069e7e6fc2ae8b9eb05f90d62 (patch) | |
tree | e60abdb20d8719e937151f481882d2bcacacc978 /gdb/ChangeLog | |
parent | ac4d7c7bfa59e47d0bcb58031c15d888158a4dfa (diff) | |
download | gdb-b3885679dd71bed069e7e6fc2ae8b9eb05f90d62.zip gdb-b3885679dd71bed069e7e6fc2ae8b9eb05f90d62.tar.gz gdb-b3885679dd71bed069e7e6fc2ae8b9eb05f90d62.tar.bz2 |
Fix handling DLL loads at run time
This patch makes handling a DLL load at run time (using LoadLibrary)
much more reliable when its file name cannot be obtained using the
lpImageName pointer provided by the DLL load debug event. The
solution is to enumerate all the DLLs loaded by the inferior, looking
for the DLL that's loaded at base address provided by the lpBaseOfDll
pointer of the debug event. Correctly resolving the DLL file name is
important, because without that GDB doesn't record the DLL in the list
of solibs, and then later is unable to show functions in that DLL in
the backtraces, which produces corrupted and truncated backtraces.
See this thread for the problems that causes:
https://sourceware.org/pipermail/gdb-patches/2021-March/177022.html
gdb/ChangeLog:
2021-04-10 Eli Zaretskii <eliz@gnu.org>
* windows-nat.c (windows_nat::handle_load_dll): Call
windows_add_dll if get_image_name failed to glean the name of the
DLL by using the lpImageName pointer.
(windows_add_all_dlls): Now a thin wrapper around windows_add_dll.
(windows_add_dll): Now does what windows_add_all_dlls did before,
but also accepts an argument LOAD_ADDR, which, if non-NULL,
specifies the address where the DLL was loaded into the inferior,
and looks for the single DLL loaded at that address.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c5ed593..5c38a4e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2021-04-10 Eli Zaretskii <eliz@gnu.org> + + * windows-nat.c (windows_nat::handle_load_dll): Call + windows_add_dll if get_image_name failed to glean the name of the + DLL by using the lpImageName pointer. + (windows_add_all_dlls): Now a thin wrapper around windows_add_dll. + (windows_add_dll): Now does what windows_add_all_dlls did before, + but also accepts an argument LOAD_ADDR, which, if non-NULL, + specifies the address where the DLL was loaded into the inferior, + and looks for the single DLL loaded at that address. + 2021-04-09 Luis Machado <luis.machado@linaro.org> * nat/aarch64-mte-linux-ptrace.c: Update include file order. |