aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1995-08-26 07:35:13 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1995-08-26 07:35:13 +0000
commit080868b4662cf9f1930714d09ad1d446dfd3a196 (patch)
tree18515318b28c97cb5214cda2e171624382018314 /gdb/stabsread.c
parent13ba8b69271683f5cc4c723a6dbd1070b9aa671f (diff)
downloadgdb-080868b4662cf9f1930714d09ad1d446dfd3a196.zip
gdb-080868b4662cf9f1930714d09ad1d446dfd3a196.tar.gz
gdb-080868b4662cf9f1930714d09ad1d446dfd3a196.tar.bz2
* 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.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 9c703e6..167da0b 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -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);