aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2009-01-07 12:11:07 +0000
committerJoel Brobecker <brobecker@gnat.com>2009-01-07 12:11:07 +0000
commitea8992ce761ee68ff11579e5b3b8e72b5c228e6a (patch)
treeef1b374397dd37d1f274074839414b3145f95c1b /gdb/utils.c
parent301d2c47d9e6622be18fec51f7f215762910f9bb (diff)
downloadgdb-ea8992ce761ee68ff11579e5b3b8e72b5c228e6a.zip
gdb-ea8992ce761ee68ff11579e5b3b8e72b5c228e6a.tar.gz
gdb-ea8992ce761ee68ff11579e5b3b8e72b5c228e6a.tar.bz2
* 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.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 5ceb7ae..9e2dfd7 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;
}