aboutsummaryrefslogtreecommitdiff
path: root/gdb/ch-valprint.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1995-11-30 03:26:34 +0000
committerPer Bothner <per@bothner.com>1995-11-30 03:26:34 +0000
commit5e54886116dd58d05183a465350c127f65fa4460 (patch)
treedf9f188beaf544b89ab36d73c970de5fb00a7f85 /gdb/ch-valprint.c
parentdcdba37e2d5970979f1d87cef209495aae83f94c (diff)
downloadgdb-5e54886116dd58d05183a465350c127f65fa4460.zip
gdb-5e54886116dd58d05183a465350c127f65fa4460.tar.gz
gdb-5e54886116dd58d05183a465350c127f65fa4460.tar.bz2
* ch-exp.y: Replaced by ...
* ch-exp.c: New file. Use recursive-descent. Recognize labelled array tuples and powerset ranges. * Makefile.in: Update for no longer using yacc for ch-exp. * c-lang.c: Make various functions non-static. * c-lang.h: Add bunches of prototypes. * cp-valprint.c (cp_print_value_fields): Also take address. (cp_print_value): Likewise. Use baselcass_offset. * stabsread.c (current_symbol): New static variable. (type_synonym_name): Remove. (read_type): If copying, make copy be a TYPE_CODE_TYPEDEF. (read_array_type): Don't need to handle undefined element type here. (cleanup_undefined_types): Ditto. (read_range_type): Look for Chill ranges. * valops.c (value_assign): Fix case lval_internalvar - don't try to assign into old value (which might be too small!). (value_coerce_array): No longer need special VALUE_REPEATED handling. (value_arg_coerce): Cleaner array->pointer decay mechanism. (search_struct_field): Use baseclass_offset rather than baseclass_addr. (value_slice): Use get_discrete_bounds. * value.h (COERCE_VARYING_ARRAY): Take type argumnt as well. * values.c (baseclass_offset): Change parameter interface. (baseclass_addr): Removed. * c-typeprint.c, c-valprint.c, ch-valprint.c, values.c, valops.c: Add check_typedef/CHECK_TYPEDEF as needed.
Diffstat (limited to 'gdb/ch-valprint.c')
-rw-r--r--gdb/ch-valprint.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gdb/ch-valprint.c b/gdb/ch-valprint.c
index 695530b..9b20137 100644
--- a/gdb/ch-valprint.c
+++ b/gdb/ch-valprint.c
@@ -78,6 +78,7 @@ chill_print_type_scalar (type, val, stream)
case TYPE_CODE_CHAR:
case TYPE_CODE_BOOL:
case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
default:
break;
}
@@ -114,7 +115,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
unsigned int reps;
LONGEST low_bound = TYPE_FIELD_BITPOS (range_type, 0);
- elttype = TYPE_TARGET_TYPE (type);
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
@@ -205,6 +206,8 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
struct type *elttype;
CORE_ADDR addr;
+ CHECK_TYPEDEF (type);
+
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
@@ -289,7 +292,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
break;
}
addr = unpack_pointer (type, valaddr);
- elttype = TYPE_TARGET_TYPE (type);
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
/* We assume a NULL pointer is all zeros ... */
if (addr == 0)
@@ -338,7 +341,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
case TYPE_CODE_BITSTRING:
case TYPE_CODE_SET:
elttype = TYPE_INDEX_TYPE (type);
- check_stub_type (elttype);
+ CHECK_TYPEDEF (elttype);
if (TYPE_FLAGS (elttype) & TYPE_FLAG_STUB)
{
fprintf_filtered (stream, "<incomplete type>");
@@ -405,7 +408,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
case TYPE_CODE_STRUCT:
if (chill_varying_type (type))
{
- struct type *inner = TYPE_FIELD_TYPE (type, 1);
+ struct type *inner = check_typedef (TYPE_FIELD_TYPE (type, 1));
long length = unpack_long (TYPE_FIELD_TYPE (type, 0), valaddr);
char *data_addr = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8;
@@ -509,7 +512,7 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
int i, len;
int fields_seen = 0;
- check_stub_type (type);
+ CHECK_TYPEDEF (type);
fprintf_filtered (stream, "[");
len = TYPE_NFIELDS (type);
@@ -575,15 +578,14 @@ chill_value_print (val, stream, format, pretty)
enum val_prettyprint pretty;
{
struct type *type = VALUE_TYPE (val);
+ struct type *real_type = check_typedef (type);
/* If it is a pointer, indicate what it points to.
- Print type also if it is a reference.
+ Print type also if it is a reference. */
- C++: if it is a member pointer, we will take care
- of that when we print it. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR ||
- TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_CODE (real_type) == TYPE_CODE_PTR ||
+ TYPE_CODE (real_type) == TYPE_CODE_REF)
{
char *valaddr = VALUE_CONTENTS (val);
CORE_ADDR addr = unpack_pointer (type, valaddr);