[pushed] Use debug_printf in windows-nat.c

Message ID 20200415184746.19913-1-tromey@adacore.com
State New
Headers show
  • [pushed] Use debug_printf in windows-nat.c
Related show

Commit Message

Tom Tromey April 15, 2020, 6:47 p.m.
While debugging a bug on Windows, I noticed that windows-nat.c is not
sending its debugging output to gdb_stdlog.  This is unfortunate
because it means that "set logging debugredirect" doesn't work

This patch fixes the problem by changing windows-nat.c to use

Note that get_windows_debug_event also writes one debugging message
unconditionally.  It isn't clear to me if this really ought to use
DEBUG_EVENTS or not, since it seems like perhaps it is intended to
note an unexpected event occurring.  So, I didn't change this.

I'm checking this in.

2020-04-15  Tom Tromey  <tromey@adacore.com>

	(DEBUG_EXCEPT): Use debug_printf.
 gdb/ChangeLog     | 5 +++++
 gdb/windows-nat.c | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)



diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 613153bfac6..e82e58ec1f2 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -217,10 +217,10 @@  static int windows_initialization_done;
 #define CHECK(x)	check (x, __FILE__,__LINE__)
-#define DEBUG_EXEC(x)	if (debug_exec)		printf_unfiltered x
-#define DEBUG_EVENTS(x)	if (debug_events)	printf_unfiltered x
-#define DEBUG_MEM(x)	if (debug_memory)	printf_unfiltered x
-#define DEBUG_EXCEPT(x)	if (debug_exceptions)	printf_unfiltered x
+#define DEBUG_EXEC(x)	if (debug_exec)		debug_printf x
+#define DEBUG_EVENTS(x)	if (debug_events)	debug_printf x
+#define DEBUG_MEM(x)	if (debug_memory)	debug_printf x
+#define DEBUG_EXCEPT(x)	if (debug_exceptions)	debug_printf x
 static void cygwin_set_dr (int i, CORE_ADDR addr);
 static void cygwin_set_dr7 (unsigned long val);