* utils.c (host_address_to_string): Reimplement in a way that
authorJoel Brobecker <brobecker@gnat.com>
Tue, 13 Jan 2009 12:06:59 +0000 (12:06 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 13 Jan 2009 12:06:59 +0000 (12:06 +0000)
        avoids the cast of the address to long.

gdb/ChangeLog
gdb/utils.c

index 0254424c2c9ca72372193dd20bcc5c9035ce1a4f..9d7cb0423934b6f37c4e398c63fd5110373bd9c7 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-13  Mark Kettenis  <kettenis@gnu.org>
+
+       * utils.c (host_address_to_string): Reimplement in a way that
+       avoids the cast of the address to long.
+
 2009-01-13  Joel Brobecker  <brobecker@adacore.com>
 
        * mdebugread.c (parse_symbol): Save the symbol private data
index 9e2dfd7709a93563a08fa93a25163270f6e7b462..877f90d437bc84f7e0040df3cee7e86abbab8ef5 100644 (file)
@@ -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;
 }
 
This page took 0.027374 seconds and 4 git commands to generate.