[PATCH 21/27] gdb: %p => host_address_to_string, handle_output_debug_string

Pedro Alves <[email protected]> Thu, 23 Jul 2026 14:01:12 +0100
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
Use host_address_to_string in
windows_per_inferior::handle_output_debug_string, which always renders
a host pointer with a "0x" prefix regardless of the C runtime, as GDB
does elsewhere for this reason.

Tested on x86_64-pc-linux-gnu and x86_64-pc-windows-msvc.

Change-Id: I4ff621443f5e3f313ed2e3efbc617d08fdb3eeaa
---
 gdb/windows-nat.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index def8fa606f4..9b223912a82 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -871,8 +871,9 @@ windows_per_inferior::handle_output_debug_string
 	    }
 	}
 
-      DEBUG_EVENTS ("gdb: cygwin signal %d, thread 0x%x, CONTEXT @ %p",
-		    gotasig, thread_id, x);
+      DEBUG_EVENTS ("gdb: cygwin signal %d, thread 0x%x, CONTEXT @ %s",
+		    gotasig, thread_id,
+		    host_address_to_string (x));
     }
 #endif
 
-- 
2.54.0