* printcmd.c (print_scalar_formatted): Move masking of 'a' address
authorAndrew Cagney <cagney@redhat.com>
Tue, 11 Jul 2000 08:51:59 +0000 (08:51 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 11 Jul 2000 08:51:59 +0000 (08:51 +0000)
from here.
(print_address_numeric): To here.
* TODO: Update.

gdb/ChangeLog
gdb/TODO
gdb/printcmd.c

index 738ed615b935c99136a08cee410de18a38f8b14b..f5c2a52704d4a2cdbe5c323f1063697cb87ae0d4 100644 (file)
@@ -1,3 +1,10 @@
+Tue Jul 11 18:32:40 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * printcmd.c (print_scalar_formatted): Move masking of 'a' address
+       from here.
+       (print_address_numeric): To here.
+       * TODO: Update.
+
 Tue Jul 11 17:50:31 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * symtab.c: Use paddr_nz() to print addresses.
index 393a0b9c4cc188b2f38887abebb38502d8fa0bc8..a3846118ee242edaecc182ce8e88f74521abc34a 100644 (file)
--- a/gdb/TODO
+++ b/gdb/TODO
@@ -115,6 +115,15 @@ determine the default isa/byte-order.
 Rely on BFD_BIG_ENDIAN and BFD_LITTLE_ENDIAN instead of host dependant
 BIG_ENDIAN and LITTLE_ENDIAN.
 
+--
+
+printcmd.c (print_address_numeric):
+
+NOTE: This assumes that the significant address information is kept in
+the least significant bits of ADDR - the upper bits were either zero
+or sign extended.  Should ADDRESS_TO_POINTER() or some
+ADDRESS_TO_PRINTABLE() be used to do the conversion?
+
 --
 
                Code Cleanups: General
index dcc3329d676a04915607b5856bae3987852ef502..629af99dc45661f8fbd73c5ec561dbfa15e368d1 100644 (file)
@@ -1,5 +1,7 @@
 /* Print values for GNU debugger GDB.
-   Copyright 1986-1991, 1993-1995, 1998, 2000 Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1995,
+   1998, 2000 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -445,14 +447,7 @@ print_scalar_formatted (valaddr, type, format, size, stream)
 
     case 'a':
       {
-       /* Truncate address to the size of a target pointer, avoiding
-          shifts larger or equal than the width of a CORE_ADDR.  The
-          local variable PTR_BIT stops the compiler reporting a shift
-          overflow when it won't occure. */
        CORE_ADDR addr = unpack_pointer (type, valaddr);
-       int ptr_bit = TARGET_PTR_BIT;
-       if (ptr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
-         addr &= ((CORE_ADDR) 1 << ptr_bit) - 1;
        print_address (addr, stream);
       }
       break;
@@ -740,8 +735,17 @@ print_address_numeric (addr, use_local, stream)
      int use_local;
      struct ui_file *stream;
 {
-  /* This assumes a CORE_ADDR can fit in a LONGEST.  Probably a safe
-     assumption.  */
+  /* Truncate address to the size of a target pointer, avoiding shifts
+     larger or equal than the width of a CORE_ADDR.  The local
+     variable PTR_BIT stops the compiler reporting a shift overflow
+     when it won't occure. */
+  /* NOTE: This assumes that the significant address information is
+     kept in the least significant bits of ADDR - the upper bits were
+     either zero or sign extended.  Should ADDRESS_TO_POINTER() or
+     some ADDRESS_TO_PRINTABLE() be used to do the conversion?  */
+  int ptr_bit = TARGET_PTR_BIT;
+  if (ptr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
+    addr &= ((CORE_ADDR) 1 << ptr_bit) - 1;
   print_longest (stream, 'x', use_local, (ULONGEST) addr);
 }
 
This page took 0.033797 seconds and 4 git commands to generate.