Share handle_load_dll and handle_unload_dll declarations
authorTom Tromey <tromey@adacore.com>
Wed, 8 Apr 2020 20:33:35 +0000 (14:33 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 8 Apr 2020 20:47:58 +0000 (14:47 -0600)
This changes nat/windows-nat.h to declare handle_load_dll and
handle_unload_dll.  The embedding application is required to implement
these -- while the actual code was difficult to share due to some
other differences between the two programs, sharing the declaration
lets a subsequent patch share more code that uses these as callbacks.

gdb/ChangeLog
2020-04-08  Tom Tromey  <tromey@adacore.com>

* windows-nat.c (windows_nat::handle_load_dll)
(windows_nat::handle_unload_dll): Rename.  No longer static.
* nat/windows-nat.h (handle_load_dll, handle_unload_dll):
Declare.

gdbserver/ChangeLog
2020-04-08  Tom Tromey  <tromey@adacore.com>

* win32-low.c (windows_nat::handle_load_dll): Rename from
handle_load_dll.  No longer static.
(windows_nat::handle_unload_dll): Rename from handle_unload_dll.
No longer static.

gdb/ChangeLog
gdb/nat/windows-nat.h
gdb/windows-nat.c
gdbserver/ChangeLog
gdbserver/win32-low.cc

index 0c288344af6de68afbc974502a10c4ebee468931..9a5e4168b1fe84e64e07ab50dd3998202e87cd74 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-08  Tom Tromey  <tromey@adacore.com>
+
+       * windows-nat.c (windows_nat::handle_load_dll)
+       (windows_nat::handle_unload_dll): Rename.  No longer static.
+       * nat/windows-nat.h (handle_load_dll, handle_unload_dll):
+       Declare.
+
 2020-04-08  Tom Tromey  <tromey@adacore.com>
 
        * complaints.h (stop_whining): Declare at top-level.
index f438befbc940c58a46c683db6b41aa0e07ae91f3..2b2fd116269cda1d39f4607e538ef8dfc7913b39 100644 (file)
@@ -125,6 +125,25 @@ extern windows_thread_info *thread_rec (ptid_t ptid,
    This function must be supplied by the embedding application.  */
 extern int handle_output_debug_string (struct target_waitstatus *ourstatus);
 
+/* Handle a DLL load event.
+
+   This function assumes that the current event did not occur during
+   inferior initialization.
+
+   This function must be supplied by the embedding application.  */
+
+extern void handle_load_dll ();
+
+/* Handle a DLL unload event.
+
+   This function assumes that this event did not occur during inferior
+   initialization.
+
+   This function must be supplied by the embedding application.  */
+
+extern void handle_unload_dll ();
+
+
 /* Currently executing process */
 extern HANDLE current_process_handle;
 extern DWORD current_process_id;
index 7ccd124ac29bdf5068e5b1d9b4d962600b7f262f..81811681ef6cdcd7d8bba78de77a3a5992752b40 100644 (file)
@@ -870,15 +870,10 @@ windows_make_so (const char *name, LPVOID load_addr)
   return so;
 }
 
-/* Handle a DLL load event, and return 1.
-
-   This function assumes that this event did not occur during inferior
-   initialization, where their event info may be incomplete (see
-   do_initial_windows_stuff and windows_add_all_dlls for more info
-   on how we handle DLL loading during that phase).  */
+/* See nat/windows-nat.h.  */
 
-static void
-handle_load_dll ()
+void
+windows_nat::handle_load_dll ()
 {
   LOAD_DLL_DEBUG_INFO *event = &current_event.u.LoadDll;
   const char *dll_name;
@@ -911,16 +906,10 @@ windows_free_so (struct so_list *so)
   xfree (so);
 }
 
-/* Handle a DLL unload event.
-   Return 1 if successful, or zero otherwise.
-
-   This function assumes that this event did not occur during inferior
-   initialization, where their event info may be incomplete (see
-   do_initial_windows_stuff and windows_add_all_dlls for more info
-   on how we handle DLL loading during that phase).  */
+/* See nat/windows-nat.h.  */
 
-static void
-handle_unload_dll ()
+void
+windows_nat::handle_unload_dll ()
 {
   LPVOID lpBaseOfDll = current_event.u.UnloadDll.lpBaseOfDll;
   struct so_list *so;
index c6aceced1912703f94518dfc71bbc730f9a421e1..e6213adf0feea52dfc038b89c03c31356c57bcd7 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-08  Tom Tromey  <tromey@adacore.com>
+
+       * win32-low.c (windows_nat::handle_load_dll): Rename from
+       handle_load_dll.  No longer static.
+       (windows_nat::handle_unload_dll): Rename from handle_unload_dll.
+       No longer static.
+
 2020-04-08  Tom Tromey  <tromey@adacore.com>
 
        * win32-low.c (handle_output_debug_string): Add parameter.  Change
index 2130366747c91aa0c02d9784627acd831eb4ed6e..73d4a6a2d8aec61f99f1b2301c9d83175b5268e8 100644 (file)
@@ -1123,15 +1123,10 @@ typedef HANDLE (WINAPI *winapi_CreateToolhelp32Snapshot) (DWORD, DWORD);
 typedef BOOL (WINAPI *winapi_Module32First) (HANDLE, LPMODULEENTRY32);
 typedef BOOL (WINAPI *winapi_Module32Next) (HANDLE, LPMODULEENTRY32);
 
-/* Handle a DLL load event.
-
-   This function assumes that this event did not occur during inferior
-   initialization, where their event info may be incomplete (see
-   do_initial_child_stuff and win32_add_all_dlls for more info on
-   how we handle DLL loading during that phase).  */
+/* See nat/windows-nat.h.  */
 
-static void
-handle_load_dll (void)
+void
+windows_nat::handle_load_dll ()
 {
   LOAD_DLL_DEBUG_INFO *event = &current_event.u.LoadDll;
   const char *dll_name;
@@ -1144,15 +1139,10 @@ handle_load_dll (void)
   win32_add_one_solib (dll_name, (CORE_ADDR) (uintptr_t) event->lpBaseOfDll);
 }
 
-/* Handle a DLL unload event.
-
-   This function assumes that this event did not occur during inferior
-   initialization, where their event info may be incomplete (see
-   do_initial_child_stuff and win32_add_one_solib for more info
-   on how we handle DLL loading during that phase).  */
+/* See nat/windows-nat.h.  */
 
-static void
-handle_unload_dll (void)
+void
+windows_nat::handle_unload_dll ()
 {
   CORE_ADDR load_addr =
          (CORE_ADDR) (uintptr_t) current_event.u.UnloadDll.lpBaseOfDll;
This page took 0.036342 seconds and 4 git commands to generate.