[PATCH 20/27] gdb: %p => host_address_to_string, find_symtab_matching_filename

Pedro Alves <[email protected]> Thu, 23 Jul 2026 14:01:11 +0100
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
Use host_address_to_string in find_symtab_matching_filename, 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: Id9feccab986d62ebcff68afac065839b2c9bed1a
---
 gdb/symfile-debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 2432a709ddf..25069a32f2a 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -282,8 +282,8 @@ objfile::find_symtab_matching_filename (const char *name,
       break;
 
   if (debug_symfile)
-    gdb_printf (gdb_stdlog, "qf->find_symtab_matching_filename (...) = %p\n",
-		result);
+    gdb_printf (gdb_stdlog, "qf->find_symtab_matching_filename (...) = %s\n",
+		host_address_to_string (result));
 
   return result;
 }
-- 
2.54.0