aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1993-12-21 22:18:51 +0000
committerPer Bothner <per@bothner.com>1993-12-21 22:18:51 +0000
commitcba009211a9e13e8c773c30fb35dd8ef61477554 (patch)
treee42b77103ff82669f7367b7e5b7c2b76de10d6ed /gdb/stabsread.c
parent0c3cab7aacb7e60306be0e798824803dca8d08d9 (diff)
downloadgdb-cba009211a9e13e8c773c30fb35dd8ef61477554.zip
gdb-cba009211a9e13e8c773c30fb35dd8ef61477554.tar.gz
gdb-cba009211a9e13e8c773c30fb35dd8ef61477554.tar.bz2
* ch-exp.y (match_dollar_tokens): Fix off-by-one bug.
* ch-lang.c (chill_is_varying_struct), ch-lang.h: New function. * ch-lang.c (chill_printstr): Use double quotes, not single quotes. * ch-typeprint.c (chill_type_print_base): Handle TYPE_CODE_BITSTRING. Improve printing of TYPE_CODE_STRING, TYPE_CODE_SET, and TYPE_CODE_STRUCT (including checking chill_is_varying_struct). Print TYPE_DUMMY_RANGE by printing its TYPE_TARGET_TYPE. Handle TYPE_CODE_ENUM. * ch-valprint.c (chill_val_print): Handle TYPE_CODE_BITSTRING. For TYPE_CODE_STRING, never print address. Handle VARYING strings. * gdbtypes.c (force_to_range_type): New. * gdbtypes.c (create_set_type): Make work, following Chill layout. * gdbtypes.h (TYPE_LOW_BOUND, TYPE_HIGH_BOUND, TYPE_DUMMY_RANGE): New. * stabsread.c (read_type): Distinguish string and bitstring from char-array and set. * valarith.c (value_subscript), valops.c (value_coerce_array): Handle STRINGs as well as ARRAYs. * valarith.c (value_bit_index): Fix think. Use new macros.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index a0c9672..66cc052 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1214,6 +1214,9 @@ read_type (pp, objfile)
there is no size attribute. */
int type_size = -1;
+ /* Used to distinguish string and bitstring from char-array and set. */
+ int is_string = 0;
+
/* Read type number if present. The type number may be omitted.
for instance in a two-dimensional array declared with type
"ar1;1;10;ar1;1;10;4". */
@@ -1263,6 +1266,8 @@ read_type (pp, objfile)
if (type_size <= 0)
type_size = -1;
break;
+ case 'S':
+ is_string = 1;
default:
/* Ignore unrecognized type attributes, so future compilers
can invent new ones. */
@@ -1566,11 +1571,15 @@ read_type (pp, objfile)
type = dbx_alloc_type (typenums, objfile);
type = read_array_type (pp, type, objfile);
+ if (is_string)
+ TYPE_CODE (type) = TYPE_CODE_STRING;
break;
case 'S':
type1 = read_type (pp, objfile);
type = create_set_type ((struct type*) NULL, type1);
+ if (is_string)
+ TYPE_CODE (type) = TYPE_CODE_BITSTRING;
if (typenums[0] != -1)
*dbx_lookup_type (typenums) = type;
break;