print-address.patch

Doug Evans dje@transmeta.com
Wed Feb 7 23:22:00 GMT 2001


The comment in print_address_numeric claims it's casting the address
to the size of [TARGET_]PTR_BIT (which sounds correct to me),
when in fact it's using TARGET_ADDR_BIT.

2001-02-07  Doug Evans  <dje@casey.transmeta.com>

	* printcmd.c (print_address_numeric): Reduce address to
	size of TARGET_PTR_BIT, not TARGET_ADDR_BIT.

*** printcmd.c.~1~	Tue Dec 19 00:40:47 2000
--- printcmd.c	Wed Feb  7 23:16:58 2001
*************** print_address_numeric (CORE_ADDR addr, i
*** 726,734 ****
       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);
  }
  
--- 726,734 ----
       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);
  }
  


More information about the Gdb-patches mailing list