diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-07-10 21:17:49 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-07-10 21:17:49 +0000 |
commit | ef166cf46a1b37daf20f3470f1478b9c1e2ddbc6 (patch) | |
tree | 814d92070941be2448f37221e08e108b2fe41fa5 /gdb/printcmd.c | |
parent | 2bf1f4a12e3577f7483aaa185c6917d8ba94a9bc (diff) | |
download | gdb-ef166cf46a1b37daf20f3470f1478b9c1e2ddbc6.zip gdb-ef166cf46a1b37daf20f3470f1478b9c1e2ddbc6.tar.gz gdb-ef166cf46a1b37daf20f3470f1478b9c1e2ddbc6.tar.bz2 |
* printcmd.c (print_scalar_formatted): If we are printing an
address, remember that TARGET_ADDR_BIT is not always equal to
TARGET_PTR_BIT.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 746a064..63b7464 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -390,6 +390,12 @@ print_scalar_formatted (char *valaddr, struct type *type, int format, int size, else if (format != 'f') val_long = unpack_long (type, valaddr); + /* If the value is a pointer, and pointers and addresses are not the + same, then at this point, the value's length is TARGET_ADDR_BIT, not + TYPE_LENGTH (type). */ + if (TYPE_CODE (type) == TYPE_CODE_PTR) + len = TARGET_ADDR_BIT; + /* If we are printing it as unsigned, truncate it in case it is actually a negative signed value (e.g. "print/u (short)-1" should print 65535 (if shorts are 16 bits) instead of 4294967295). */ |