This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: comment and whitespace fix-ups, printcmd.c
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH]: comment and whitespace fix-ups, printcmd.c
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Wed, 28 Feb 2001 19:46:19 -0800
- Newsgroups: cygnus.patches.gdb
- Organization: Red Hat
Update one comment to refer to the sizeof a target address, rather than
the sizeof a target pointer. Shorten one excessively long line by removing
unnecessary whitespace.
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).
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 printcmd.c
*** printcmd.c 2001/02/25 04:45:11 1.15
--- printcmd.c 2001/03/01 03:52:15
*************** build_address_symbolic (CORE_ADDR addr,
*** 718,732 ****
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
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 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);
--- 718,734 ----
void
print_address_numeric (CORE_ADDR addr, int use_local, struct ui_file *stream)
{
! /* Truncate address to the size of a target address, avoiding shifts
larger or equal than the width of a CORE_ADDR. The local
! 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);
*************** x_command (char *exp, int from_tty)
*** 1334,1341 ****
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
&& VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val);
else
--- 1336,1343 ----
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
&& VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val);
else