aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarfread.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
committerFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
commitec16f7015b91a7324011b41f6a13dfab0fd5d21a (patch)
treee7f4babdb56207372200a6e11c3f46b4bbcacb97 /gdb/dwarfread.c
parentfa2b89f1032989451742a5a75bcdec34736f903a (diff)
downloadgdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.zip
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.gz
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.bz2
* c-exp.y (exp): Add production to support direct creation
of array constants using the obvious syntax. * c-valprint.c (c_val_print): Set printed string length. * dwarfread.c (read_tag_string_type): New prototype and function that handles TAG_string_type DIEs. * dwarfread.c (process_dies): Add case for TAG_string_type that calls new read_tag_string_type function. * expprint.c (print_subexp): Add support for OP_ARRAY. * gdbtypes.c (create_range_type, create_array_type): Inherit objfile from the index type. **** start-sanitize-chill **** * ch-typeprint.c (chill_print_type): Add case for TYPE_CODE_STRING. * ch-valprint.c (chill_val_print): Fix case for TYPE_CODE_STRING. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/dwarfread.c')
-rw-r--r--gdb/dwarfread.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index 3da9e76..688976a 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -523,6 +523,9 @@ static void
read_tag_pointer_type PARAMS ((struct dieinfo *dip));
static void
+read_tag_string_type PARAMS ((struct dieinfo *dip));
+
+static void
read_subroutine_type PARAMS ((struct dieinfo *, char *, char *));
static void
@@ -1526,6 +1529,60 @@ read_tag_pointer_type (dip)
LOCAL FUNCTION
+ read_tag_string_type -- read TAG_string_type DIE
+
+SYNOPSIS
+
+ static void read_tag_string_type (struct dieinfo *dip)
+
+DESCRIPTION
+
+ Extract all information from a TAG_string_type DIE and add to
+ the user defined type vector. It isn't really a user defined
+ type, but it behaves like one, with other DIE's using an
+ AT_user_def_type attribute to reference it.
+ */
+
+static void
+read_tag_string_type (dip)
+ struct dieinfo *dip;
+{
+ struct type *utype;
+ struct type *indextype;
+ struct type *rangetype;
+ unsigned long lowbound = 0;
+ unsigned long highbound;
+
+ if ((utype = lookup_utype (dip -> die_ref)) != NULL)
+ {
+ /* Ack, someone has stuck a type in the slot we want. Complain
+ about it. */
+ complain (&dup_user_type_definition, DIE_ID, DIE_NAME);
+ }
+ 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 = create_string_type ((struct type *) NULL, rangetype);
+ alloc_utype (dip -> die_ref, utype);
+ }
+}
+
+/*
+
+LOCAL FUNCTION
+
read_subroutine_type -- process TAG_subroutine_type dies
SYNOPSIS
@@ -2011,6 +2068,9 @@ process_dies (thisdie, enddie, objfile)
case TAG_pointer_type:
read_tag_pointer_type (&di);
break;
+ case TAG_string_type:
+ read_tag_string_type (&di);
+ break;
default:
new_symbol (&di, objfile);
break;