* gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.

* gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
	what cleanup_undefined_types does for arrays, except we clear
	TYPE_FLAG_TARGET_STUB if we fix up the type.
	* stabsread.c (cleanup_undefined_types): Add comments about how
	doing arrays here is no longer the clean way to do it.
	(read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
	add_undefined_type.
	* c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
	outside switch so it happens for all type codes.
	* cp-valprint.c (cp_print_value_fields): Recurse to val_print,
	instead of c_val_print, so that check_stub_type gets called.

	* gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
	TYPE_FLAG_SIGNED.  It was inconsistently set, never checked
	(except in recursive_dump_type), and is pointless.
This commit is contained in:
Jim Kingdon 1993-11-15 20:13:30 +00:00
parent f130fb33e5
commit dda398c369
10 changed files with 119 additions and 59 deletions

View file

@ -21,9 +21,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (GDBTYPES_H)
#define GDBTYPES_H 1
/* When gdb creates fundamental types, it uses one of the following
type identifiers. The identifiers are used to index a vector of
pointers to any types that are created. */
/* Codes for `fundamental types'. This is a monstrosity based on the
bogus notion that there are certain compiler-independent
`fundamental types'. None of these is well-defined (how big is
FT_SHORT? Does it depend on the language? How does the
language-specific code know which type to correlate to FT_SHORT?) */
#define FT_VOID 0
#define FT_BOOLEAN 1
@ -114,20 +116,23 @@ enum type_code
/* Some bits for the type's flags word. */
/* Explicitly unsigned integer type */
/* Unsigned integer type. If this is not set for a TYPE_CODE_INT, the
type is signed. */
#define TYPE_FLAG_UNSIGNED (1 << 0)
/* Explicitly signed integer type */
#define TYPE_FLAG_SIGNED (1 << 1)
/* This appears in a type's flags word if it is a stub type (e.g., if
someone referenced a type that wasn't defined in a source file
via (struct sir_not_appearing_in_this_film *)). */
#define TYPE_FLAG_STUB (1 << 2)
/* The target type of this type is a stub type, and this type needs to
be updated if it gets un-stubbed in check_stub_type. Currently only
used for arrays, in which TYPE_LENGTH of the array gets set based
on the TYPE_LENGTH of the target type. */
#define TYPE_FLAG_TARGET_STUB (1 << 3)
struct type
{