2007-08-17 Michael Snyder <msnyder@access-company.com>
[deliverable/binutils-gdb.git] / gdb / ui-out.c
index 98c81739144ab9d35ac91ad02514ee76d2c5af53..a85ca48ea6ee6adaa11436bc3f6ffb68146ebc01 100644 (file)
@@ -1,6 +1,6 @@
 /* Output generating routines for GDB.
 
-   Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005
+   Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
@@ -493,12 +493,17 @@ ui_out_field_core_addr (struct ui_out *uiout,
                        CORE_ADDR address)
 {
   char addstr[20];
+  int addr_bit = gdbarch_addr_bit (current_gdbarch);
+
+  /* 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.  */
+     based on gdbarch_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));
This page took 0.023561 seconds and 4 git commands to generate.