aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2007-03-26 13:54:30 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2007-03-26 13:54:30 +0000
commita72d8a8e4b3ebfaa20f53a35103e3b3946f31daa (patch)
tree7f240f4b9e14fad1c0c1d541b1659e2bdd41b35a /gdb/ui-out.c
parentf4b39977c8162c118d6f8ebfacd1fc5850ec2842 (diff)
downloadgdb-a72d8a8e4b3ebfaa20f53a35103e3b3946f31daa.zip
gdb-a72d8a8e4b3ebfaa20f53a35103e3b3946f31daa.tar.gz
gdb-a72d8a8e4b3ebfaa20f53a35103e3b3946f31daa.tar.bz2
* ui-out.c (ui_out_field_core_addr): Truncate address to
TARGET_ADDR_BIT size before printing.
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r--gdb/ui-out.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index ba61c9a..eec2d40 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -493,12 +493,17 @@ ui_out_field_core_addr (struct ui_out *uiout,
CORE_ADDR address)
{
char addstr[20];
+ int addr_bit = TARGET_ADDR_BIT;
+
+ /* Truncate address to match deprecated_print_address_numeric(). */
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
+ address &= ((CORE_ADDR) 1 << addr_bit) - 1;
/* FIXME: cagney/2002-05-03: Need local_address_string() function
that returns the language localized string formatted to a width
based on TARGET_ADDR_BIT. */
/* deprecated_print_address_numeric (address, 1, local_stream); */
- if (TARGET_ADDR_BIT <= 32)
+ if (addr_bit <= 32)
strcpy (addstr, hex_string_custom (address, 8));
else
strcpy (addstr, hex_string_custom (address, 16));