diff options
author | Michael Snyder <msnyder@vmware.com> | 2001-03-01 03:56:45 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2001-03-01 03:56:45 +0000 |
commit | c0d8fd9a10852a25399210bb9156512f68797df3 (patch) | |
tree | 084e73b0626063880dccc7c34d1bd5fc99c05cae | |
parent | d85310f71af68bfa2bc1d11911ca82dc24f55709 (diff) | |
download | fsf-binutils-gdb-c0d8fd9a10852a25399210bb9156512f68797df3.zip fsf-binutils-gdb-c0d8fd9a10852a25399210bb9156512f68797df3.tar.gz fsf-binutils-gdb-c0d8fd9a10852a25399210bb9156512f68797df3.tar.bz2 |
2001-02-28 Michael Snyder <msnyder@mvstp600e.cygnus.com>
* printcmd.c (print_address_numeric): Update comments to refer
to sizeof addr, not sizeof pointer.
(x_command): Remove needless whitespace (shorten long line).
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/printcmd.c | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5fad469..9fe834a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2001-02-28 Michael Snyder <msnyder@mvstp600e.cygnus.com> + * printcmd.c (print_address_numeric): Update comments to refer + to sizeof addr, not sizeof pointer. + (x_command): Remove needless whitespace (shorten long line). + * breakpoint.c (print_one_breakpoint): Formatting clean-up. (read_memory_nobpt): Ditto. (ep_is_catchpoint): Ditto. diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 8c14077..d560cbb 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -718,15 +718,17 @@ build_address_symbolic (CORE_ADDR addr, /* IN */ void print_address_numeric (CORE_ADDR addr, int use_local, struct ui_file *stream) { - /* Truncate address to the size of a target pointer, avoiding shifts + /* Truncate address to the size of a target address, 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. */ + variable ADDR_BIT stops the compiler reporting a shift overflow + when it won't occur. */ /* 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 addr_bit = TARGET_ADDR_BIT; + if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT)) addr &= ((CORE_ADDR) 1 << addr_bit) - 1; print_longest (stream, 'x', use_local, (ULONGEST) addr); @@ -1334,8 +1336,8 @@ x_command (char *exp, int from_tty) val = value_ind (val); /* In rvalue contexts, such as this, functions are coerced into pointers to functions. This makes "x/i main" work. */ - if ( /* last_format == 'i' - && */ TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC + if (/* last_format == 'i' && */ + TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC && VALUE_LVAL (val) == lval_memory) next_address = VALUE_ADDRESS (val); else |