From 49b563f9d8f6a88d61fb6d0fa7a370a659d948d6 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Wed, 13 Feb 2002 06:06:26 +0000 Subject: [PATCH] * defs.h (core_addr_to_string_nz): New function. * utils.c (core_addr_to_string): Use phex instead of phex_nz. (core_addr_to_string_nz): New function. --- gdb/ChangeLog | 6 ++++++ gdb/utils.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 53dc6a969af..0bf78e9ea96 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-02-12 Keith Seitz + + * defs.h (core_addr_to_string_nz): New function. + * utils.c (core_addr_to_string): Use phex instead of phex_nz. + (core_addr_to_string_nz): New function. + 2002-02-11 Richard Earnshaw * arm-linux-nat.c: Really include arm-tdep.h. diff --git a/gdb/utils.c b/gdb/utils.c index e27769f5ba9..627c89e39ec 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -2473,6 +2473,15 @@ address_to_host_pointer (CORE_ADDR addr) /* Convert a CORE_ADDR into a string. */ const char * core_addr_to_string (const CORE_ADDR addr) +{ + char *str = get_cell (); + strcpy (str, "0x"); + strcat (str, phex (addr, sizeof (addr))); + return str; +} + +const char * +core_addr_to_string_nz (const CORE_ADDR addr) { char *str = get_cell (); strcpy (str, "0x"); -- 2.30.2