forked from Imagelibrary/binutils-gdb
* mdebugread.c (parse_symbol): Handle sh.value of zero for enums.
Determine signedness of enum type from enumerators. (parse_type): Handle btIndirect types, handle fBitfield for some non-member types. (upgrade_type): Use TYPE_FLAG_TARGET_STUB for arrays with unknown length. (cross_ref): Handle stIndirect forward reference to btTypedef. * stabsread.c (read_enum_type): Determine signedness of enum type from enumerators. * top.c (execute_command): Remove trailing whitespace from command arguments, except for `set' and `complete' commands. (validate_comname): Allow underscores in user defined command names. * values.c (modify_field): Change `Value does not fit in %d bits' error to a warning. Exclude sign extension bits of negative field values from fit check.
This commit is contained in:
@@ -3050,6 +3050,7 @@ read_enum_type (pp, type, objfile)
|
||||
struct pending *osyms, *syms;
|
||||
int o_nsyms;
|
||||
int nbits;
|
||||
int unsigned_enum = 1;
|
||||
|
||||
#if 0
|
||||
/* FIXME! The stabs produced by Sun CC merrily define things that ought
|
||||
@@ -3107,6 +3108,8 @@ read_enum_type (pp, type, objfile)
|
||||
SYMBOL_CLASS (sym) = LOC_CONST;
|
||||
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
|
||||
SYMBOL_VALUE (sym) = n;
|
||||
if (n < 0)
|
||||
unsigned_enum = 0;
|
||||
add_symbol_to_list (sym, symlist);
|
||||
nsyms++;
|
||||
}
|
||||
@@ -3119,6 +3122,8 @@ read_enum_type (pp, type, objfile)
|
||||
TYPE_LENGTH (type) = TARGET_INT_BIT / HOST_CHAR_BIT;
|
||||
TYPE_CODE (type) = TYPE_CODE_ENUM;
|
||||
TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
|
||||
if (unsigned_enum)
|
||||
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
|
||||
TYPE_NFIELDS (type) = nsyms;
|
||||
TYPE_FIELDS (type) = (struct field *)
|
||||
TYPE_ALLOC (type, sizeof (struct field) * nsyms);
|
||||
|
||||
Reference in New Issue
Block a user