From 773698b58ca0ea3177fc34ff4233b80ebb70ce0c Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 13 Jan 2009 12:06:59 +0000 Subject: [PATCH] * utils.c (host_address_to_string): Reimplement in a way that avoids the cast of the address to long. --- gdb/ChangeLog | 5 +++++ gdb/utils.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0254424c2c9..9d7cb042393 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-01-13 Mark Kettenis + + * utils.c (host_address_to_string): Reimplement in a way that + avoids the cast of the address to long. + 2009-01-13 Joel Brobecker * mdebugread.c (parse_symbol): Save the symbol private data diff --git a/gdb/utils.c b/gdb/utils.c index 9e2dfd7709a..877f90d437b 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -3071,10 +3071,7 @@ 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); + xsnprintf (str, CELLSIZE, "0x%s", phex_nz ((uintptr_t) addr, sizeof (addr))); return str; } -- 2.30.2