summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-07-11 08:51:59 +0000
committerAndrew Cagney <cagney@redhat.com>2000-07-11 08:51:59 +0000
commit59026b4f67ff8bdcedde213e8aa9ece955f6f28d (patch)
tree928892105179efbec877a4d5671c76b16d40ecf6
parent8bbf0f4ba825d004c66fd69cb34cec63318cbab3 (diff)
downloadgdb-59026b4f67ff8bdcedde213e8aa9ece955f6f28d.tar.gz
* printcmd.c (print_scalar_formatted): Move masking of 'a' address
from here. (print_address_numeric): To here. * TODO: Update.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/TODO9
-rw-r--r--gdb/printcmd.c24
3 files changed, 30 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 738ed615b93..f5c2a52704d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/TODO b/gdb/TODO
index 393a0b9c4cc..a3846118ee2 100644
--- a/gdb/TODO
+++ b/gdb/TODO
@@ -117,6 +117,15 @@ 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
======================
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index dcc3329d676..629af99dc45 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -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);
}