Wrap shared windows-nat code in windows_nat namespace
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 wraps the shared windows-nat code in a windows_nat namespace.
This helps avoid name clashes.

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

* windows-nat.c: Add "using namespace".
* nat/windows-nat.h: Wrap contents in windows_nat namespace.
* nat/windows-nat.c: Wrap contents in windows_nat namespace.

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

* win32-low.h (struct win32_target_ops): Use qualified names where
needed.
* win32-i386-low.c: Add "using namespace".
* win32-low.c: Add "using namespace".
* win32-arm-low.c: Add "using namespace".

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

index 91f84c68c91ef14c5c66eff1cd8a989cd04c5b59..0286fd61f106a41af077af67b42a5cda0ebd7667 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-08  Tom Tromey  <tromey@adacore.com>
+
+       * windows-nat.c: Add "using namespace".
+       * nat/windows-nat.h: Wrap contents in windows_nat namespace.
+       * nat/windows-nat.c: Wrap contents in windows_nat namespace.
+
 2020-04-08  Tom Tromey  <tromey@adacore.com>
 
        * nat/windows-nat.h (struct windows_thread_info): Declare
index ca3e3087944ff0a41677e6e837c1bc8a5d5f2de7..6c0218cd9d8cd7e91d29d004603d7d49d1bb164c 100644 (file)
@@ -19,6 +19,9 @@
 #include "gdbsupport/common-defs.h"
 #include "nat/windows-nat.h"
 
+namespace windows_nat
+{
+
 windows_thread_info::~windows_thread_info ()
 {
   CloseHandle (h);
@@ -65,3 +68,5 @@ windows_thread_info::resume ()
     }
   suspended = 0;
 }
+
+}
index ccdf207140e986e649a355d800a9f40cc1afeba4..df28364675356024e134e7665c407f7936237311 100644 (file)
@@ -21,6 +21,9 @@
 
 #include <windows.h>
 
+namespace windows_nat
+{
+
 /* Thread information structure used to track extra information about
    each thread.  */
 struct windows_thread_info
@@ -87,4 +90,6 @@ struct windows_thread_info
   gdb::unique_xmalloc_ptr<char> name;
 };
 
+}
+
 #endif
index ef900ea1ebde1bffeb3c8f006c55ecb28167ad2b..8f848b961993efaca5888896fbf38f08dea43620 100644 (file)
@@ -75,6 +75,8 @@
 #define STATUS_WX86_BREAKPOINT 0x4000001F
 #define STATUS_WX86_SINGLE_STEP 0x4000001E
 
+using namespace windows_nat;
+
 #define AdjustTokenPrivileges          dyn_AdjustTokenPrivileges
 #define DebugActiveProcessStop         dyn_DebugActiveProcessStop
 #define DebugBreakProcess              dyn_DebugBreakProcess
index e72741357d586a683895d0f3903fd74545883520..8de29e5c7c8da2fef60ffa8b26d136e0665390da 100644 (file)
@@ -1,3 +1,11 @@
+2020-04-08  Tom Tromey  <tromey@adacore.com>
+
+       * win32-low.h (struct win32_target_ops): Use qualified names where
+       needed.
+       * win32-i386-low.c: Add "using namespace".
+       * win32-low.c: Add "using namespace".
+       * win32-arm-low.c: Add "using namespace".
+
 2020-04-08  Tom Tromey  <tromey@adacore.com>
 
        * win32-low.c (delete_thread_info): Don't call CloseHandle.
index c50c5dfdbf2b7016d3374d7839ec0320b1cb497a..78b7fd09ec3266466f4701df4ef03fc5c9cff0e3 100644 (file)
@@ -18,6 +18,8 @@
 #include "server.h"
 #include "win32-low.h"
 
+using namespace windows_nat;
+
 #ifndef CONTEXT_FLOATING_POINT
 #define CONTEXT_FLOATING_POINT 0
 #endif
index 1b78cf98b33bc9b0958a171fe850620815e8aece..1c14bc70362586a883fd975cb426d4e3cd5c391f 100644 (file)
@@ -26,6 +26,8 @@
 #include "tdesc.h"
 #include "x86-tdesc.h"
 
+using namespace windows_nat;
+
 #ifndef CONTEXT_EXTENDED_REGISTERS
 #define CONTEXT_EXTENDED_REGISTERS 0
 #endif
index c642d47764cad1cfc6999898656c12501d3160ab..8f8b6cedd28bf35917e05bb96f702dd9ad0cbda1 100644 (file)
@@ -36,6 +36,8 @@
 #include "gdbsupport/common-inferior.h"
 #include "gdbsupport/gdb_wait.h"
 
+using namespace windows_nat;
+
 #ifndef USE_WIN32API
 #include <sys/cygwin.h>
 #endif
index 28ac2b082d9d45ba0b07f3836b9947dccfd7104a..917f72756229d9648bc4434abc7a255f7d646a78 100644 (file)
@@ -40,23 +40,25 @@ struct win32_target_ops
   void (*initial_stuff) (void);
 
   /* Fetch the context from the inferior.  */
-  void (*get_thread_context) (windows_thread_info *th);
+  void (*get_thread_context) (windows_nat::windows_thread_info *th);
 
   /* Called just before resuming the thread.  */
-  void (*prepare_to_resume) (windows_thread_info *th);
+  void (*prepare_to_resume) (windows_nat::windows_thread_info *th);
 
   /* Called when a thread was added.  */
-  void (*thread_added) (windows_thread_info *th);
+  void (*thread_added) (windows_nat::windows_thread_info *th);
 
   /* Fetch register from gdbserver regcache data.  */
   void (*fetch_inferior_register) (struct regcache *regcache,
-                                  windows_thread_info *th, int r);
+                                  windows_nat::windows_thread_info *th,
+                                  int r);
 
   /* Store a new register value into the thread context of TH.  */
   void (*store_inferior_register) (struct regcache *regcache,
-                                  windows_thread_info *th, int r);
+                                  windows_nat::windows_thread_info *th,
+                                  int r);
 
-  void (*single_step) (windows_thread_info *th);
+  void (*single_step) (windows_nat::windows_thread_info *th);
 
   const unsigned char *breakpoint;
   int breakpoint_len;
@@ -143,7 +145,7 @@ public:
 };
 
 /* Retrieve the context for this thread, if not already retrieved.  */
-extern void win32_require_context (windows_thread_info *th);
+extern void win32_require_context (windows_nat::windows_thread_info *th);
 
 /* Map the Windows error number in ERROR to a locale-dependent error
    message string and return a pointer to it.  Typically, the values
This page took 0.039365 seconds and 4 git commands to generate.