summaryrefslogtreecommitdiff
path: root/gdb/c-typeprint.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/c-typeprint.c
parentdcdba37e2d5970979f1d87cef209495aae83f94c (diff)
downloadbinutils-gdb-5e54886116dd58d05183a465350c127f65fa4460.tar.gz
* 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/c-typeprint.c')
-rw-r--r--gdb/c-typeprint.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index af61d8a9ffb..9be2d52c8ad 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -50,9 +50,6 @@ cp_type_print_derivation_info PARAMS ((GDB_FILE *, struct type *));
void
c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
-void
-c_type_print_base PARAMS ((struct type *, GDB_FILE *, int, int));
-
/* Print a description of a type in the format of a
typedef for the current language.
@@ -64,6 +61,7 @@ c_typedef_print (type, new, stream)
struct symbol *new;
GDB_FILE *stream;
{
+ CHECK_TYPEDEF (type);
switch (current_language->la_language)
{
#ifdef _LANG_c
@@ -118,6 +116,9 @@ c_print_type (type, varstring, stream, show, level)
register enum type_code code;
int demangled_args;
+ if (show > 0)
+ CHECK_TYPEDEF (type);
+
c_type_print_base (type, stream, show, level);
code = TYPE_CODE (type);
if ((varstring != NULL && *varstring != '\0')
@@ -315,6 +316,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
case TYPE_CODE_STRING:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
/* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */
break;
@@ -453,6 +455,7 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
case TYPE_CODE_STRING:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_COMPLEX:
+ case TYPE_CODE_TYPEDEF:
/* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been considered. */
break;
@@ -510,10 +513,11 @@ c_type_print_base (type, stream, show, level)
return;
}
- check_stub_type (type);
+ CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
{
+ case TYPE_CODE_TYPEDEF:
case TYPE_CODE_ARRAY:
case TYPE_CODE_PTR:
case TYPE_CODE_MEMBER: