diff options
author | Fred Fish <fnf@specifix.com> | 1991-11-20 13:07:12 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1991-11-20 13:07:12 +0000 |
commit | 768be6e12bda562ecab1834a8a92e6b636301946 (patch) | |
tree | 170992d0ecb3ddbd7df8d9a6fb03f989f857a784 | |
parent | f7c88ce784a6053d6de1862259c165f4e488fc41 (diff) | |
download | gdb-768be6e12bda562ecab1834a8a92e6b636301946.zip gdb-768be6e12bda562ecab1834a8a92e6b636301946.tar.gz gdb-768be6e12bda562ecab1834a8a92e6b636301946.tar.bz2 |
Recognize obsolete form of AT_element_list attribute still used by AT&T
compilers on one platform, and possibly more.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/dwarfread.c | 35 |
2 files changed, 37 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 679155b..b213a0c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Wed Nov 20 05:04:40 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c: Recognize obsolete form of AT_element_list + attribute still used by at least one AT&T compiler, and possibly + more. + Tue Nov 19 07:53:55 1991 Fred Fish (fnf at cygnus.com) * dwarfread.c (enum_type, struct_type): Ignore names invented by diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 551d771..5eaf6a3 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -96,6 +96,17 @@ typedef unsigned int DIEREF; /* Reference to a DIE */ #define STREQ(a,b) (strcmp(a,b)==0) +/* The Amiga SVR4 header file <dwarf.h> defines AT_element_list as a + FORM_BLOCK2, and this is the value emitted by the AT&T compiler. + However, the Issue 2 DWARF specification from AT&T defines it as + a FORM_BLOCK4, as does the latest specification from UI/PLSIG. + For backwards compatibility with the AT&T compiler produced executables + we define AT_short_element_list for this variant. */ + +#define AT_short_element_list (0x00f0|FORM_BLOCK2) + +/* External variables referenced. */ + extern CORE_ADDR startup_file_start; /* From blockframe.c */ extern CORE_ADDR startup_file_end; /* From blockframe.c */ extern CORE_ADDR entry_scope_lowpc; /* From blockframe.c */ @@ -172,6 +183,7 @@ struct dieinfo { short at_prototyped; unsigned int has_at_low_pc:1; unsigned int has_at_stmt_list:1; + unsigned int short_element_list:1; }; static int diecount; /* Approximate count of dies for compilation unit */ @@ -1319,7 +1331,8 @@ DEFUN(enum_type, (dip), struct dieinfo *dip) char *tpart3; char *scan; char *listend; - long temp; + long ltemp; + short stemp; if ((type = lookup_utype (dip -> dieref)) == NULL) { @@ -1347,9 +1360,18 @@ DEFUN(enum_type, (dip), struct dieinfo *dip) TYPE_NAME (type) = concat (tpart1, tpart2, tpart3, NULL); if ((scan = dip -> at_element_list) != NULL) { - (void) memcpy (&temp, scan, sizeof (temp)); - listend = scan + temp + sizeof (temp); - scan += sizeof (temp); + if (dip -> short_element_list) + { + (void) memcpy (&stemp, scan, sizeof (stemp)); + listend = scan + stemp + sizeof (stemp); + scan += sizeof (stemp); + } + else + { + (void) memcpy (<emp, scan, sizeof (ltemp)); + listend = scan + ltemp + sizeof (ltemp); + scan += sizeof (ltemp); + } while (scan < listend) { new = (struct nextfield *) alloca (sizeof (struct nextfield)); @@ -3472,6 +3494,11 @@ DEFUN(completedieinfo, (dip), struct dieinfo *dip) break; case AT_element_list: dip -> at_element_list = diep; + dip -> short_element_list = 0; + break; + case AT_short_element_list: + dip -> at_element_list = diep; + dip -> short_element_list = 1; break; case AT_discr_value: dip -> at_discr_value = diep; |