* printcmd.c (print_scalar_formatted): Truncate addresses to the

size of a target pointer before passing them to print_address.
This commit is contained in:
Peter Schauer 2000-03-22 20:55:15 +00:00
parent 1a309862a7
commit 593de6a6a5
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2000-03-22 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
* printcmd.c (print_scalar_formatted): Truncate addresses to the
size of a target pointer before passing them to print_address.
2000-03-22 Mark Kettenis <kettenis@gnu.org>
* config/i386/tm-i386aix.h (I386_AIX_TARGET): Remove.

View File

@ -443,7 +443,14 @@ print_scalar_formatted (valaddr, type, format, size, stream)
break;
case 'a':
print_address (unpack_pointer (type, valaddr), stream);
{
/* Truncate address to the size of a target pointer, avoiding
shifts larger or equal than the width of a CORE_ADDR. */
CORE_ADDR addr = unpack_pointer (type, valaddr);
if (TARGET_PTR_BIT < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
addr &= ((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1;
print_address (addr, stream);
}
break;
case 'c':