From ea8992ce761ee68ff11579e5b3b8e72b5c228e6a Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 7 Jan 2009 12:11:07 +0000 Subject: [PATCH] * utils.c (gdb_print_host_address): Adjust implementation to reuse host_address_to_string. Move comment explaining the conversion from host address to string from here... (host_address_to_string): ... to there. --- gdb/ChangeLog | 7 +++++++ gdb/utils.c | 11 +++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 432c76eb06f..feea4fd535b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2009-01-07 Joel Brobecker + + * utils.c (gdb_print_host_address): Adjust implementation to + reuse host_address_to_string. Move comment explaining the conversion + from host address to string from here... + (host_address_to_string): ... to there. + 2009-01-07 Emi Suzuki * MAINTAINERS: Add myself for write after approval privileges. diff --git a/gdb/utils.c b/gdb/utils.c index 5ceb7aef643..9e2dfd7709a 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1261,12 +1261,7 @@ print_spaces (int n, struct ui_file *file) void gdb_print_host_address (const void *addr, struct ui_file *stream) { - - /* We could use the %p conversion specifier to fprintf if we had any - way of knowing whether this host supports it. But the following - should work on the Alpha and on 32 bit machines. */ - - fprintf_filtered (stream, "0x%lx", (unsigned long) addr); + fprintf_filtered (stream, "%s", host_address_to_string (addr)); } @@ -3075,6 +3070,10 @@ const char * host_address_to_string (const void *addr) { char *str = get_cell (); + + /* We could use the %p conversion specifier to sprintf if we had any + way of knowing whether this host supports it. But the following + should work on the Alpha and on 32 bit machines. */ sprintf (str, "0x%lx", (unsigned long) addr); return str; } -- 2.30.2