aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-12-05 11:56:20 +0000
committerJohn Gilmore <gnu@cygnus>1991-12-05 11:56:20 +0000
commit2a5ec41d888f9f6004f237670e676ea5617f281e (patch)
tree50ebecce00b9c431f91c988785bf39faa2753bc9 /gdb/valprint.c
parent98618bf78adc8b432655d41f088e66556538e5df (diff)
downloadgdb-2a5ec41d888f9f6004f237670e676ea5617f281e.zip
gdb-2a5ec41d888f9f6004f237670e676ea5617f281e.tar.gz
gdb-2a5ec41d888f9f6004f237670e676ea5617f281e.tar.bz2
Fix things pointed up by Fred Fish's test suite; see ChangeLog.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 9680850..139679a 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -671,11 +671,7 @@ val_print (type, valaddr, address, stream, format,
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
- /* FIXME: TYPE_LENGTH (type) is unsigned and therefore always
- >= 0. Is "> 0" meant? I'm not sure what an "array of
- unspecified length" (mentioned in the comment for the else-part
- of this if) is. */
- if (TYPE_LENGTH (type) >= 0
+ if (TYPE_LENGTH (type) > 0
&& TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
{
elttype = TYPE_TARGET_TYPE (type);
@@ -772,7 +768,7 @@ val_print (type, valaddr, address, stream, format,
addr = unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr);
- if (addr < 128)
+ if (addr < 128) /* FIXME! What is this 128? */
{
len = TYPE_NFN_FIELDS (domain);
for (i = 0; i < len; i++)
@@ -854,7 +850,7 @@ val_print (type, valaddr, address, stream, format,
/* Somehow pointing into a field. */
i -= 1;
extra = (val - TYPE_FIELD_BITPOS (domain, i));
- if (extra & 0x3)
+ if (extra & 0x7)
bits = 1;
else
extra >>= 3;
@@ -1463,6 +1459,7 @@ type_print_varspec_prefix (type, stream, show, passed_a_ptr)
0);
if (passed_a_ptr)
fprintf_filtered (stream, "(");
+ break;
case TYPE_CODE_UNDEF:
case TYPE_CODE_STRUCT: