summaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>2002-09-10 02:04:38 +0000
committerFred Fish <fnf@specifix.com>2002-09-10 02:04:38 +0000
commitce8dda6d547c1ce82e3e24d4d4b07c8b856dab93 (patch)
treedcab785ef5f09e4ff88b9a6689ff7079ef9e332c /gdb/printcmd.c
parent586c4863c0b856e617175f5accc1a7c88d229d4a (diff)
downloadgdb-ce8dda6d547c1ce82e3e24d4d4b07c8b856dab93.tar.gz
Reviewed and approved by Kevin Buettner <kevinb@redhat.com>
2002-09-09 Fred Fish <fnf@intrinsity.com> * printcmd.c (print_scalar_formatted): "len" is the number of target bytes, NOT the number of target bits.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 2e57050105f..8542b8a9a5b 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -391,10 +391,10 @@ print_scalar_formatted (char *valaddr, struct type *type, int format, int size,
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). */
+ same, then at this point, the value's length (in target bytes) is
+ TARGET_ADDR_BIT/TARGET_CHAR_BIT, not TYPE_LENGTH (type). */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- len = TARGET_ADDR_BIT;
+ len = TARGET_ADDR_BIT / TARGET_CHAR_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