]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Improve support for loading DLLs at run time in gdbserver.
authorEli Zaretskii <eliz@gnu.org>
Sun, 11 Apr 2021 18:37:29 +0000 (21:37 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 11 Apr 2021 18:37:29 +0000 (21:37 +0300)
commit114ee2a4aef573bf43ab71b9d0b85aaccfd8852e
treef63578c4ffeea8b90a29241355159d22f64af262
parent2cbb0a1b2e757951251b5389505d278f9322aee4
Improve support for loading DLLs at run time in gdbserver.

This fixes win32-low.cc in the same way as a recent change in
windows-nat.c did for GDB: if the lpImageName member of the load-DLL
debug event doesn't allow us to find the file name of the DLL, then
loop over all the DLLs mapped into the inferior to find the one loaded
at the same base address as given by the lpBaseOfDll member of the
debug event.

gdbserver/ChangeLog:

2021-04-11  Eli Zaretskii  <eliz@gnu.org>

* win32-low.cc (win32_add_dll): New function, with body almost
identical to what win32_add_all_dlls did.  Accepts one argument;
if that is non-NULL, returns the file name of the DLL that is
loaded at the base address equal to that argument, or NULL if not
found.  If the argument is NULL, add all the DLLs loaded by the
inferior to the list of solibs and return NULL.
(win32_add_all_dlls): Now a thin wrapper around win32_add_dll.
(windows_nat::handle_load_dll) [!_WIN32_WCE]: If get_image_name
failed to glean the file name of the DLL, call win32_add_dll to
try harder using the lpBaseOfDll member of the load-DLL event.
gdbserver/ChangeLog
gdbserver/win32-low.cc