]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: Move setting of process_info::tdesc into win32-i386-low.cc
authorHannes Domani <ssbssa@yahoo.de>
Mon, 26 Jan 2026 18:34:16 +0000 (19:34 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Mon, 26 Jan 2026 18:34:16 +0000 (19:34 +0100)
It's arch-specific, and since now win32_tdesc and wow64_win32_tdesc are
only used in this file, they are made static.

Approved-By: Tom Tromey <tom@tromey.com>
gdbserver/win32-i386-low.cc
gdbserver/win32-low.cc
gdbserver/win32-low.h

index dfdbbf872dd7ea97f1d95525a1200d63bd958837..7e88d16fdd9805f31a886c5080e8e2860a04474f 100644 (file)
@@ -47,6 +47,13 @@ using namespace windows_nat;
 
 static struct x86_debug_reg_state debug_reg_state;
 
+/* The inferior's target description.  This is a global because the
+   Windows ports support neither bi-arch nor multi-process.  */
+static const_target_desc_up win32_tdesc;
+#ifdef __x86_64__
+static const_target_desc_up wow64_win32_tdesc;
+#endif
+
 static void
 update_debug_registers (thread_info *thread)
 {
@@ -219,8 +226,15 @@ x86_stopped_data_addresses ()
 }
 
 static void
-i386_initial_stuff (void)
+i386_initial_stuff (process_info *proc)
 {
+#ifdef __x86_64__
+  if (windows_process.wow64_process)
+    proc->tdesc = wow64_win32_tdesc.get ();
+  else
+#endif
+    proc->tdesc = win32_tdesc.get ();
+
   x86_low_init_dregs (&debug_reg_state);
 }
 
index fb4da6488db62e77f4c3196801cd549b7d2fbf23..6c0a7e16ac9162ca720e702586b47ad416be1f7c 100644 (file)
@@ -62,11 +62,6 @@ gdbserver_windows_process windows_process;
 
 int using_threads = 1;
 
-const_target_desc_up win32_tdesc;
-#ifdef __x86_64__
-const_target_desc_up wow64_win32_tdesc;
-#endif
-
 #define NUM_REGS (the_low_target.num_regs ())
 
 /* The current debug event from WaitForDebugEvent.  */
@@ -324,17 +319,11 @@ do_initial_child_stuff (HANDLE proch, DWORD pid, int attached)
 #endif
 
   proc = add_process (pid, attached);
-#ifdef __x86_64__
-  if (windows_process.wow64_process)
-    proc->tdesc = wow64_win32_tdesc.get ();
-  else
-#endif
-    proc->tdesc = win32_tdesc.get ();
   child_init_thread_list ();
   windows_process.child_initialization_done = 0;
 
   if (the_low_target.initial_stuff != NULL)
-    (*the_low_target.initial_stuff) ();
+    (*the_low_target.initial_stuff) (proc);
 
   windows_process.cached_status.set_ignore ();
 
index 2196376fccbb21cce5487a5011846b72978beeb1..a8109b7caf094607677dfe910f621071c25fb18f 100644 (file)
 
 struct target_desc;
 
-/* The inferior's target description.  This is a global because the
-   Windows ports support neither bi-arch nor multi-process.  */
-extern const_target_desc_up win32_tdesc;
-#ifdef __x86_64__
-extern const_target_desc_up wow64_win32_tdesc;
-#endif
-
 #ifdef __CYGWIN__
 constexpr enum gdb_osabi WINDOWS_OSABI = GDB_OSABI_CYGWIN;
 #else
@@ -48,7 +41,7 @@ struct win32_target_ops
   int (*num_regs) (void);
 
   /* Perform initializations on startup.  */
-  void (*initial_stuff) (void);
+  void (*initial_stuff) (process_info *proc);
 
   /* Fetch the context from the inferior.  */
   void (*get_thread_context) (windows_nat::windows_thread_info *th);