aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarfread.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-02-23 19:30:22 +0000
committerFred Fish <fnf@specifix.com>1993-02-23 19:30:22 +0000
commitb6236d6ec4f9d7f02e363da16f24c4f1e5a58fea (patch)
treeb279dfd69da6764416c85903610c7756b83270ed /gdb/dwarfread.c
parentba7f177aeb38d378795851fec10745697cd7fd29 (diff)
downloadgdb-b6236d6ec4f9d7f02e363da16f24c4f1e5a58fea.zip
gdb-b6236d6ec4f9d7f02e363da16f24c4f1e5a58fea.tar.gz
gdb-b6236d6ec4f9d7f02e363da16f24c4f1e5a58fea.tar.bz2
* ch-lang.c (chill_create_fundamental_type): Track compiler
change that now emits debugging info with the type long for Chill longs. * dwarfread.c (read_tag_string_type): Rewrite to allow forward references of TAG_string_type DIEs in user defined types.
Diffstat (limited to 'gdb/dwarfread.c')
-rw-r--r--gdb/dwarfread.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 688976a..c516800 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -1553,30 +1553,39 @@ read_tag_string_type (dip)
unsigned long lowbound = 0;
unsigned long highbound;
- if ((utype = lookup_utype (dip -> die_ref)) != NULL)
+ if (dip -> has_at_byte_size)
{
- /* Ack, someone has stuck a type in the slot we want. Complain
- about it. */
- complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
+ /* A fixed bounds string */
+ highbound = dip -> at_byte_size - 1;
}
else
{
- if (dip -> has_at_byte_size)
- {
- /* A fixed bounds string */
- highbound = dip -> at_byte_size - 1;
- }
- else
+ /* A varying length string. Stub for now. (FIXME) */
+ highbound = 1;
+ }
+ indextype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
+ rangetype = create_range_type ((struct type *) NULL, indextype, lowbound,
+ highbound);
+
+ utype = lookup_utype (dip -> die_ref);
+ if (utype == NULL)
+ {
+ /* No type defined, go ahead and create a blank one to use. */
+ utype = alloc_utype (dip -> die_ref, (struct type *) NULL);
+ }
+ else
+ {
+ /* Already a type in our slot due to a forward reference. Make sure it
+ is a blank one. If not, complain and leave it alone. */
+ if (TYPE_CODE (utype) != TYPE_CODE_UNDEF)
{
- /* A varying length string. Stub for now. (FIXME) */
- highbound = 1;
+ complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
+ return;
}
- indextype = dwarf_fundamental_type (current_objfile, FT_INTEGER);
- rangetype = create_range_type ((struct type *) NULL, indextype,
- lowbound, highbound);
- utype = create_string_type ((struct type *) NULL, rangetype);
- alloc_utype (dip -> die_ref, utype);
}
+
+ /* Create the string type using the blank type we either found or created. */
+ utype = create_string_type (utype, rangetype);
}
/*