[binutils-gdb] Windows gdb: Move debug macros to windows-nat.h

Pedro Alves via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3f22512bd43e264380481281a2f4a713326b2ce4

commit 3f22512bd43e264380481281a2f4a713326b2ce4
Author: Pedro Alves <[email protected]>
Date:   Tue Apr 7 19:48:30 2026 +0100

    Windows gdb: Move debug macros to windows-nat.h
    
    Move the Windows native debug macros to gdb/windows-nat.h, so that
    they can by used in x86-windows-nat.c.
    
    Change-Id: I002b3e3e319bcb005b2c6424affd750a0fcd1a83
    commit-id:5ec9181a

Diff:
---
 gdb/windows-nat.c | 20 +++++---------------
 gdb/windows-nat.h | 17 +++++++++++++++++
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index b2142469474..fba1ae6c40b 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -87,17 +87,11 @@ windows_per_inferior *windows_process;
 #define _CYGWIN_SIGNAL_STRING "cYgSiGw00f"
 #endif
 
-#define DEBUG_EXEC(fmt, ...) \
-  debug_prefixed_printf_cond (debug_exec, "windows exec", fmt, ## __VA_ARGS__)
-#define DEBUG_EVENTS(fmt, ...) \
-  debug_prefixed_printf_cond (debug_events, "windows events", fmt, \
-			      ## __VA_ARGS__)
-#define DEBUG_MEM(fmt, ...) \
-  debug_prefixed_printf_cond (debug_memory, "windows mem", fmt, \
-			      ## __VA_ARGS__)
-#define DEBUG_EXCEPT(fmt, ...) \
-  debug_prefixed_printf_cond (debug_exceptions, "windows except", fmt, \
-			      ## __VA_ARGS__)
+/* Debug options.  */
+bool debug_exec = false;	/* show execution */
+bool debug_events = false;	/* show events from kernel */
+bool debug_memory = false;	/* show target memory accesses */
+bool debug_exceptions = false;	/* show target exceptions */
 
 /* User options.  */
 static bool new_console = false;
@@ -105,10 +99,6 @@ static bool new_console = false;
 static bool cygwin_exceptions = false;
 #endif
 static bool new_group = true;
-static bool debug_exec = false;		/* show execution */
-static bool debug_events = false;	/* show events from kernel */
-static bool debug_memory = false;	/* show target memory accesses */
-static bool debug_exceptions = false;	/* show target exceptions */
 static bool useshell = false;		/* use shell for subprocesses */
 
 /* See windows_nat_target::resume to understand why this is commented
diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h
index 15a177214f2..e5084631e5d 100644
--- a/gdb/windows-nat.h
+++ b/gdb/windows-nat.h
@@ -26,6 +26,23 @@
 #include "nat/windows-nat.h"
 #include "ser-event.h"
 
+extern bool debug_exec;		/* show execution */
+extern bool debug_events;	/* show events from kernel */
+extern bool debug_memory;	/* show target memory accesses */
+extern bool debug_exceptions;	/* show target exceptions */
+
+#define DEBUG_EXEC(fmt, ...) \
+  debug_prefixed_printf_cond (debug_exec, "windows exec", fmt, ## __VA_ARGS__)
+#define DEBUG_EVENTS(fmt, ...) \
+  debug_prefixed_printf_cond (debug_events, "windows events", fmt, \
+			      ## __VA_ARGS__)
+#define DEBUG_MEM(fmt, ...) \
+  debug_prefixed_printf_cond (debug_memory, "windows mem", fmt, \
+			      ## __VA_ARGS__)
+#define DEBUG_EXCEPT(fmt, ...) \
+  debug_prefixed_printf_cond (debug_exceptions, "windows except", fmt, \
+			      ## __VA_ARGS__)
+
 using windows_nat::windows_thread_info;
 
 /* A pointer to a function that should return non-zero iff REGNUM
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.