diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-01-13 12:06:59 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-01-13 12:06:59 +0000 |
commit | 773698b58ca0ea3177fc34ff4233b80ebb70ce0c (patch) | |
tree | 3b1bf0db3f4252d6f085c33cf148fb766e2be2ae /gdb/utils.c | |
parent | 9918cab95eb6340daa271757ef1ee5557cd3ea4e (diff) | |
download | gdb-773698b58ca0ea3177fc34ff4233b80ebb70ce0c.zip gdb-773698b58ca0ea3177fc34ff4233b80ebb70ce0c.tar.gz gdb-773698b58ca0ea3177fc34ff4233b80ebb70ce0c.tar.bz2 |
* utils.c (host_address_to_string): Reimplement in a way that
avoids the cast of the address to long.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 9e2dfd7..877f90d 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; } |