gdbserver/windows: Ignore DLL load/unload events during child initialization.
authorJoel Brobecker <brobecker@adacore.com>
Mon, 24 Feb 2014 23:21:12 +0000 (15:21 -0800)
committerJoel Brobecker <brobecker@adacore.com>
Wed, 26 Feb 2014 20:02:44 +0000 (12:02 -0800)
commitf25b3fc33406d83293679955ac9fba088cd5ac5c
tree6729838a5d2489f6859519be1a22e337dd3e6500
parent31aa7e4ee988b175da848cee7cff6cfb28a5aa99
gdbserver/windows: Ignore DLL load/unload events during child initialization.

This GDBserver patch mirrors a change made in GDB wich aims at
simplifying DLL handling during the inferior initialization
(process creation during the "run", or during an "attach").
Instead of processing each DLL load event, which is sometimes
incomplete, we ignore these events until the inferior has completed
its startup phase, and then just iterate over all DLLs via
EnumProcessModules.

As a side-effect, it fixes a small bug where win32_ensure_ntdll_loaded
was missing a 0x1000 offset in the DLL base address. This problem
should only be visible on the 64bit version of Windows 8.1, since
this is the only platform where win32_ensure_ntdll_loaded is actually
needed.

gdb/gdbserver/ChangeLog:

* win32-low.c (win32_add_all_dlls): Renames
win32_ensure_ntdll_loaded.  Rewrite function documentation.
Adjust implementation to always load all DLLs.
Add 0x1000 offset to DLL base address when calling
win32_add_one_solib.
(child_initialization_done): New static global.
(do_initial_child_stuff): Set child_initialization_done to
zero during child initialization, and 1 after.  Replace call
to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
Add comment.
(match_dll_by_basename, dll_is_loaded_by_basename): Delete.
(handle_unload_dll): Add function documentation.
(get_child_debug_event): Ignore load and unload DLL events
during child initialization.
gdb/gdbserver/ChangeLog
gdb/gdbserver/win32-low.c