From: Fred Fish Date: Wed, 20 Nov 1991 13:07:12 +0000 (+0000) Subject: Recognize obsolete form of AT_element_list attribute still used by AT&T X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=768be6e12bda562ecab1834a8a92e6b636301946;p=binutils-gdb.git Recognize obsolete form of AT_element_list attribute still used by AT&T compilers on one platform, and possibly more. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 679155b710a..b213a0c9ebd 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 551d771c477..5eaf6a39dad 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 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;