Share DLL code between gdb and gdbserver
authorTom Tromey <tromey@adacore.com>
Fri, 30 Apr 2021 16:22:23 +0000 (10:22 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 30 Apr 2021 16:22:24 +0000 (10:22 -0600)
commite228ef975e92d3bc860fc6b87039447392ba53aa
treea42a01934906c6be7a513b6abf370cb34f21620c
parentde0718729053b7c558166f3cc1a7d170c48a25de
Share DLL code between gdb and gdbserver

This moves the new DLL-loading code into nat/windows-nat.c, and
changes both gdb and gdbserver to use the shared code.  One
client-provided callback, handle_load_dll, is changed to allow the
code to be shared.  This callback was actually never called from
nat/windows-nat.c; maybe I had planned to share more here and then
didn't finish... I'm not sure.

gdb/ChangeLog
2021-04-30  Tom Tromey  <tromey@adacore.com>

* windows-nat.c (windows_nat::handle_load_dll): Update.
(windows_nat_target::get_windows_debug_event): Call
dll_loaded_event.
(windows_add_all_dlls, windows_add_dll): Move to
nat/windows-nat.c.
* nat/windows-nat.h (handle_load_dll): Change parameters.
(dll_loaded_event, windows_add_all_dlls): Declare.
* nat/windows-nat.c (windows_add_dll, windows_add_all_dlls): Move
from windows-nat.c.
(dll_loaded_event): New function.

gdbserver/ChangeLog
2021-04-30  Tom Tromey  <tromey@adacore.com>

* win32-low.cc (do_initial_child_stuff): Update.
(windows_nat::handle_load_dll): Rename from win32_add_one_solib.
Change parameter type.
(win32_add_dll, win32_add_all_dlls)
(windows_nat::handle_load_dll): Remove.
(get_child_debug_event): Call dll_loaded_event.
gdb/ChangeLog
gdb/nat/windows-nat.c
gdb/nat/windows-nat.h
gdb/windows-nat.c
gdbserver/ChangeLog
gdbserver/win32-low.cc