* ui-out.c (ui_out_field_core_addr): Truncate address to
authorMaciej W. Rozycki <macro@linux-mips.org>
Mon, 26 Mar 2007 13:54:30 +0000 (13:54 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Mon, 26 Mar 2007 13:54:30 +0000 (13:54 +0000)
TARGET_ADDR_BIT size before printing.

gdb/ChangeLog
gdb/ui-out.c

index 634f463ed5ac5f1dea38d28fd26dbf4fd95d8935..2f682ef3335a01f52fa90086e9c00c37c2739989 100644 (file)
@@ -1,5 +1,11 @@
+2007-03-26  Nigel Stephens  <nigel@mips.com>
+            Maciej W. Rozycki  <macro@mips.com>
+
+       * ui-out.c (ui_out_field_core_addr): Truncate address to
+       TARGET_ADDR_BIT size before printing.
+
 2007-03-22  Nigel Stephens  <nigel@mips.com>
-           Maciej W. Rozycki  <macro@mips.com>
+            Maciej W. Rozycki  <macro@mips.com>
 
        * remote-mips.c (mips_xfer_memory): Update prototype.
 
index ba61c9a882bfb4a7ea65e1cfb3a403c6753db9d1..eec2d401d5876a7917d666b7a12a2caffe196ca8 100644 (file)
@@ -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));
This page took 0.03182 seconds and 4 git commands to generate.