other things to work on, if you get bored. :-)
*/
-
#include <stdio.h>
+#ifdef __STDC__
#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
#include <fcntl.h>
#include "defs.h"
-#include "param.h"
#include "bfd.h"
#include "symtab.h"
#include "symfile.h"
#define STREQ(a,b) (strcmp(a,b)==0)
-extern CORE_ADDR entry_point; /* Process entry point */
+/* 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 */
Some fields have a flag <name>_p that is set when the value of the
field is valid (I.E. we found a matching attribute in the DIE). Since
we may want to test for the presence of some attributes in the DIE,
- such as AT_is_external, without restricting the values of the field,
+ such as AT_low_pc, without restricting the values of the field,
we need someway to note that we found such an attribute.
*/
long at_byte_size;
short at_bit_offset;
long at_bit_size;
- BLOCK * at_deriv_list;
BLOCK * at_element_list;
long at_stmt_list;
long at_low_pc;
BLOCK * at_string_length;
char * at_comp_dir;
char * at_producer;
- long at_loclist;
long at_frame_base;
- short at_incomplete;
long at_start_scope;
long at_stride_size;
long at_src_info;
short at_prototyped;
- BLOCK * at_const_data;
- short at_is_external;
- unsigned int at_is_external_p:1;
- unsigned int at_stmt_list_p:1;
+ 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 */
static void
EXFUN (scan_compilation_units,
(char *filename AND CORE_ADDR addr AND char *thisdie AND char *enddie
- AND unsigned int dbfoff AND unsigned int lnoffset));
+ AND unsigned int dbfoff AND unsigned int lnoffset
+ AND struct objfile *objfile));
static struct partial_symtab *
-EXFUN(start_psymtab, (char *symfile_name AND CORE_ADDR addr
+EXFUN(start_psymtab, (struct objfile *objfile AND CORE_ADDR addr
AND char *filename AND CORE_ADDR textlow
AND CORE_ADDR texthigh AND int dbfoff
AND int curoff AND int culength AND int lnfoff
EXFUN(dwarf_psymtab_to_symtab, (struct partial_symtab *pst));
static void
-EXFUN(psymtab_to_symtab_1, (struct partial_symtab *pst AND int desc ));
+EXFUN(psymtab_to_symtab_1, (struct partial_symtab *pst));
static struct symtab *
-EXFUN(read_ofile_symtab, (struct partial_symtab *pst AND int desc));
+EXFUN(read_ofile_symtab, (struct partial_symtab *pst));
static void
-EXFUN(process_dies, (char *thisdie AND char *enddie));
-
-static void
-EXFUN(read_lexical_block_scope,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
+EXFUN(process_dies,
+ (char *thisdie AND char *enddie AND struct objfile *objfile));
static void
EXFUN(read_structure_scope,
static struct type *
EXFUN(enum_type, (struct dieinfo *dip));
-static void
-EXFUN(read_func_scope,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
-
-static void
-EXFUN(read_file_scope,
- (struct dieinfo *dip AND char *thisdie AND char *enddie));
-
static void
EXFUN(start_symtab, (void));
static void
-EXFUN(end_symtab, (char *filename AND long language));
+EXFUN(end_symtab,
+ (char *filename AND long language AND struct objfile *objfile));
static int
EXFUN(scopecount, (struct scopenode *node));
EXFUN(locval, (char *loc));
static void
-EXFUN(record_misc_function, (char *name AND CORE_ADDR address));
+EXFUN(record_misc_function, (char *name AND CORE_ADDR address AND
+ enum misc_function_type));
static int
EXFUN(compare_psymbols,
void dwarf_build_psymtabs (int desc, char *filename, CORE_ADDR addr,
int mainline, unsigned int dbfoff, unsigned int dbsize,
- unsigned int lnoffset, unsigned int lnsize)
+ unsigned int lnoffset, unsigned int lnsize,
+ struct objfile *objfile)
DESCRIPTION
void
DEFUN(dwarf_build_psymtabs,
- (desc, filename, addr, mainline, dbfoff, dbsize, lnoffset, lnsize),
+ (desc, filename, addr, mainline, dbfoff, dbsize, lnoffset, lnsize,
+ objfile),
int desc AND
char *filename AND
CORE_ADDR addr AND
unsigned int dbfoff AND
unsigned int dbsize AND
unsigned int lnoffset AND
- unsigned int lnsize)
+ unsigned int lnsize AND
+ struct objfile *objfile)
{
struct cleanup *back_to;
init_psymbol_list (1024);
}
- init_misc_bunches ();
- make_cleanup (discard_misc_bunches, 0);
-
/* Follow the compilation unit sibling chain, building a partial symbol
table entry for each one. Save enough information about each compilation
unit to locate the full DWARF information later. */
scan_compilation_units (filename, addr, dbbase, dbbase + dbsize,
- dbfoff, lnoffset);
-
- /* Go over the miscellaneous functions and install them in the miscellaneous
- function vector. */
+ dbfoff, lnoffset, objfile);
- condense_misc_bunches (!mainline);
do_cleanups (back_to);
}
SYNOPSIS
- static void record_misc_function (char *name, CORE_ADDR address)
+ static void record_misc_function (char *name, CORE_ADDR address,
+ enum misc_function_type mf_type)
DESCRIPTION
symbol, records this information for later use in building the
miscellaneous function vector.
-NOTES
-
- FIXME: For now we just use mf_text as the type. This should be
- fixed.
*/
static void
-DEFUN(record_misc_function, (name, address), char *name AND CORE_ADDR address)
+DEFUN(record_misc_function, (name, address, mf_type),
+ char *name AND CORE_ADDR address AND enum misc_function_type mf_type)
{
prim_record_misc_function (obsavestring (name, strlen (name)), address,
- mf_text);
+ mf_type);
}
/*
information for the DIE where the problem was noticed.
*/
+#ifdef __STDC__
static void
DEFUN(dwarfwarn, (fmt), char *fmt DOTS)
{
fflush (stderr);
va_end (ap);
}
+#else
+static void
+dwarfwarn (va_alist)
+ va_dcl
+{
+ va_list ap;
+ char *fmt;
+
+ va_start (ap);
+ fmt = va_arg (ap, char *);
+ warning_setup ();
+ fprintf (stderr, "DWARF warning (ref 0x%x): ", curdie -> dieref);
+ if (curdie -> at_name)
+ {
+ fprintf (stderr, "'%s': ", curdie -> at_name);
+ }
+ vfprintf (stderr, fmt, ap);
+ fprintf (stderr, "\n");
+ fflush (stderr);
+ va_end (ap);
+}
+#endif
/*
LOCAL FUNCTION
*/
static void
-DEFUN(read_lexical_block_scope, (dip, thisdie, enddie),
+DEFUN(read_lexical_block_scope, (dip, thisdie, enddie, objfile),
struct dieinfo *dip AND
char *thisdie AND
- char *enddie)
+ char *enddie AND
+ struct objfile *objfile)
{
openscope (NULL, dip -> at_low_pc, dip -> at_high_pc);
- process_dies (thisdie + dip -> dielength, enddie);
+ process_dies (thisdie + dip -> dielength, enddie, objfile);
closescope ();
}
{
type = alloc_utype (dip -> dieref, NULL);
}
- switch (dip -> dietag)
+ if (dip -> dietag == TAG_structure_type || dip -> dietag == TAG_union_type)
+ {
+ TYPE_CPLUS_SPECIFIC (type) = (struct cplus_struct_type *)
+ obstack_alloc (symbol_obstack, sizeof (struct cplus_struct_type));
+ (void) memset (TYPE_CPLUS_SPECIFIC (type), 0,
+ sizeof (struct cplus_struct_type));
+ if (dip -> dietag == TAG_structure_type)
+ {
+ TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ tpart1 = "struct ";
+ }
+ else
+ {
+ TYPE_CODE (type) = TYPE_CODE_UNION;
+ tpart1 = "union ";
+ }
+ }
+ else
{
- case TAG_structure_type:
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- tpart1 = "struct ";
- break;
- case TAG_union_type:
- TYPE_CODE (type) = TYPE_CODE_UNION;
- tpart1 = "union ";
- break;
- default:
tpart1 = "";
SQUAWK (("missing structure or union tag"));
TYPE_CODE (type) = TYPE_CODE_UNDEF;
- break;
}
- if (dip -> at_name == NULL)
+ /* Some compilers try to be helpful by inventing "fake" names for anonymous
+ enums, structures, and unions, like "~0fake". Thanks, but no thanks. */
+ if (dip -> at_name == NULL
+ || *dip -> at_name == '~'
+ || *dip -> at_name == '.')
{
tpart2 = "{...}";
}
TYPE_LENGTH (type) = dip -> at_byte_size;
tpart3 = "";
}
- TYPE_NAME (type) = concat (tpart1, tpart2, tpart3);
+ TYPE_NAME (type) = concat (tpart1, tpart2, tpart3, NULL);
thisdie += dip -> dielength;
while (thisdie < enddie)
{
char *tpart3;
char *scan;
char *listend;
- long temp;
+ long ltemp;
+ short stemp;
if ((type = lookup_utype (dip -> dieref)) == NULL)
{
}
TYPE_CODE (type) = TYPE_CODE_ENUM;
tpart1 = "enum ";
- if (dip -> at_name == NULL)
+ /* Some compilers try to be helpful by inventing "fake" names for anonymous
+ enums, structures, and unions, like "~0fake". Thanks, but no thanks. */
+ if (dip -> at_name == NULL
+ || *dip -> at_name == '~'
+ || *dip -> at_name == '.')
{
tpart2 = "{...}";
} else {
TYPE_LENGTH (type) = dip -> at_byte_size;
tpart3 = "";
}
- TYPE_NAME (type) = concat (tpart1, tpart2, tpart3);
+ 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));
read_func_scope -- process all dies within a function scope
-SYNOPSIS
-
- static void read_func_scope (struct dieinfo dip, char *thisdie,
- char *enddie)
-
DESCRIPTION
Process all dies within a given function scope. We are passed
*/
static void
-DEFUN(read_func_scope, (dip, thisdie, enddie),
+DEFUN(read_func_scope, (dip, thisdie, enddie, objfile),
struct dieinfo *dip AND
char *thisdie AND
- char *enddie)
+ char *enddie AND
+ struct objfile *objfile)
{
struct symbol *sym;
}
sym = new_symbol (dip);
openscope (sym, dip -> at_low_pc, dip -> at_high_pc);
- process_dies (thisdie + dip -> dielength, enddie);
+ process_dies (thisdie + dip -> dielength, enddie, objfile);
closescope ();
}
read_file_scope -- process all dies within a file scope
-SYNOPSIS
-
- static void read_file_scope (struct dieinfo *dip, char *thisdie
- char *enddie)
-
DESCRIPTION
Process all dies within a given file scope. We are passed a
*/
static void
-DEFUN(read_file_scope, (dip, thisdie, enddie),
+DEFUN(read_file_scope, (dip, thisdie, enddie, objfile),
struct dieinfo *dip AND
char *thisdie AND
- char *enddie)
+ char *enddie AND
+ struct objfile *objfile)
{
struct cleanup *back_to;
start_symtab ();
openscope (NULL, dip -> at_low_pc, dip -> at_high_pc);
decode_line_numbers (lnbase);
- process_dies (thisdie + dip -> dielength, enddie);
+ process_dies (thisdie + dip -> dielength, enddie, objfile);
closescope ();
- end_symtab (dip -> at_name, dip -> at_language);
+ end_symtab (dip -> at_name, dip -> at_language, objfile);
do_cleanups (back_to);
utypes = NULL;
numutypes = 0;
*/
static void
-DEFUN(process_dies, (thisdie, enddie), char *thisdie AND char *enddie)
+DEFUN(process_dies, (thisdie, enddie, objfile),
+ char *thisdie AND char *enddie AND struct objfile *objfile)
{
char *nextdie;
struct dieinfo di;
switch (di.dietag)
{
case TAG_compile_unit:
- read_file_scope (&di, thisdie, nextdie);
+ read_file_scope (&di, thisdie, nextdie, objfile);
break;
case TAG_global_subroutine:
case TAG_subroutine:
- if (!di.at_is_external_p)
+ if (di.has_at_low_pc)
{
- read_func_scope (&di, thisdie, nextdie);
+ read_func_scope (&di, thisdie, nextdie, objfile);
}
break;
case TAG_lexical_block:
- read_lexical_block_scope (&di, thisdie, nextdie);
+ read_lexical_block_scope (&di, thisdie, nextdie, objfile);
break;
case TAG_structure_type:
case TAG_union_type:
*/
static void
-DEFUN(end_symtab, (filename, language), char *filename AND long language)
+DEFUN(end_symtab, (filename, language, objfile),
+ char *filename AND long language AND struct objfile *objfile)
{
struct symtab *symtab;
struct blockvector *blockvector;
/* Now create the symtab object for this source file. */
- symtab = (struct symtab *) xmalloc (sizeof (struct symtab));
- (void) memset (symtab, 0, sizeof (struct symtab));
+ symtab = allocate_symtab (savestring (filename, strlen (filename)),
+ objfile);
symtab -> free_ptr = 0;
/* Fill in its components. */
symtab -> blockvector = blockvector;
symtab -> free_code = free_linetable;
- symtab -> filename = savestring (filename, strlen (filename));
/* Save the line number information. */
nbytes += (line_vector_index - 1) * sizeof (struct linetable_entry);
}
symtab -> linetable = (struct linetable *) xrealloc (line_vector, nbytes);
- symtab -> nlines = 0;
- symtab -> line_charpos = 0;
/* FIXME: The following may need to be expanded for other languages */
- if (language == LANG_C89 || language == LANG_C)
+ switch (language)
{
- symtab -> language = language_c;
+ case LANG_C89:
+ case LANG_C:
+ symtab -> language = language_c;
+ break;
+ case LANG_C_PLUS_PLUS:
+ symtab -> language = language_cplus;
+ break;
+ default:
+ ;
}
-
+
/* Link the new symtab into the list of such. */
symtab -> next = symtab_list;
symtab_list = symtab;
SYNOPSIS
- static struct symtab *read_ofile_symtab (struct partial_symtab *pst,
- int desc)
+ static struct symtab *read_ofile_symtab (struct partial_symtab *pst)
DESCRIPTION
- DESC is the file descriptor for the file, positioned at the
- beginning of the symtab
- SYM_SIZE is the size of the symbol section to read
- TEXT_OFFSET is the beginning of the text segment we are reading
- symbols for
- TEXT_SIZE is the size of the text segment read in.
- OFFSET is a relocation offset which gets added to each symbol
-
+ OFFSET is a relocation offset which gets added to each symbol (FIXME).
*/
static struct symtab *
-DEFUN(read_ofile_symtab, (pst, desc),
- struct partial_symtab *pst AND
- int desc)
+DEFUN(read_ofile_symtab, (pst),
+ struct partial_symtab *pst)
{
struct cleanup *back_to;
long lnsize;
int foffset;
+ bfd *abfd = pst->objfile->obfd;
/* Allocate a buffer for the entire chunk of DIE's for this compilation
unit, seek to the location in the file, and read in all the DIE's. */
dbbase = xmalloc (DBLENGTH(pst));
dbroff = DBROFF(pst);
foffset = DBFOFF(pst) + dbroff;
- if ((lseek (desc, foffset, 0) != foffset) ||
- (read (desc, dbbase, DBLENGTH(pst)) != DBLENGTH(pst)))
+ if (bfd_seek (abfd, foffset, 0) ||
+ (bfd_read (dbbase, DBLENGTH(pst), 1, abfd) != DBLENGTH(pst)))
{
free (dbbase);
error ("can't read DWARF data");
lnbase = NULL;
if (LNFOFF (pst))
{
- if ((lseek (desc, LNFOFF (pst), 0) != LNFOFF (pst)) ||
- (read (desc, &lnsize, sizeof(long)) != sizeof(long)))
+ if (bfd_seek (abfd, LNFOFF (pst), 0) ||
+ (bfd_read (&lnsize, sizeof(long), 1, abfd) != sizeof(long)))
{
error ("can't read DWARF line number table size");
}
lnbase = xmalloc (lnsize);
- if ((lseek (desc, LNFOFF (pst), 0) != LNFOFF (pst)) ||
- (read (desc, lnbase, lnsize) != lnsize))
+ if (bfd_seek (abfd, LNFOFF (pst), 0) ||
+ (bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
{
free (lnbase);
error ("can't read DWARF line numbers");
make_cleanup (free, lnbase);
}
- process_dies (dbbase, dbbase + DBLENGTH(pst));
+ process_dies (dbbase, dbbase + DBLENGTH(pst), pst->objfile);
do_cleanups (back_to);
return (symtab_list);
}
SYNOPSIS
- static void psymtab_to_symtab_1 (struct partial_symtab *pst, int desc)
+ static void psymtab_to_symtab_1 (struct partial_symtab *pst)
DESCRIPTION
static void
DEFUN(psymtab_to_symtab_1,
- (pst, desc),
- struct partial_symtab *pst AND
- int desc)
+ (pst),
+ struct partial_symtab *pst)
{
int i;
wrap_here (""); /* Flush output */
fflush (stdout);
}
- psymtab_to_symtab_1 (pst -> dependencies[i], desc);
+ psymtab_to_symtab_1 (pst -> dependencies[i]);
}
if (DBLENGTH(pst)) /* Otherwise it's a dummy */
{
/* Init stuff necessary for reading in symbols */
- pst -> symtab = read_ofile_symtab (pst, desc);
+ pst -> symtab = read_ofile_symtab (pst);
if (info_verbose)
{
printf_filtered ("%d DIE's, sorting...", diecount);
static void
DEFUN(dwarf_psymtab_to_symtab, (pst), struct partial_symtab *pst)
{
- int desc;
- struct cleanup *old_chain;
- bfd *sym_bfd;
-
+
if (!pst)
{
return;
fflush (stdout);
}
- /* Open symbol file. Symbol_file_command guarantees that the symbol
- file name will be absolute, so there is no need for openp. */
- desc = open (pst -> symfile_name, O_RDONLY, 0);
-
- if (desc < 0)
- {
- perror_with_name (pst -> symfile_name);
- }
-
- sym_bfd = bfd_fdopenr (pst -> symfile_name, NULL, desc);
- if (!sym_bfd)
- {
- (void) close (desc);
- error ("Could not open `%s' to read symbols: %s",
- pst -> symfile_name, bfd_errmsg (bfd_error));
- }
- old_chain = make_cleanup (bfd_close, sym_bfd);
- if (!bfd_check_format (sym_bfd, bfd_object))
- {
- error ("\"%s\": can't read symbols: %s.",
- pst -> symfile_name, bfd_errmsg (bfd_error));
- }
-
- psymtab_to_symtab_1 (pst, desc);
+ psymtab_to_symtab_1 (pst);
#if 0 /* FIXME: Check to see what dbxread is doing here and see if
we need to do an equivalent or is this something peculiar to
scan_file_globals ();
#endif
- do_cleanups (old_chain);
-
/* Finish up the debug error message. */
if (info_verbose)
{
static struct partial_symtab *
DEFUN(start_psymtab,
- (symfile_name, addr, filename, textlow, texthigh, dbfoff, curoff,
+ (objfile, addr, filename, textlow, texthigh, dbfoff, curoff,
culength, lnfoff, global_syms, static_syms),
- char *symfile_name AND
+ struct objfile *objfile AND
CORE_ADDR addr AND
char *filename AND
CORE_ADDR textlow AND
obstack_alloc (psymbol_obstack, sizeof (struct partial_symtab));
(void) memset (result, 0, sizeof (struct partial_symtab));
result -> addr = addr;
- result -> symfile_name = create_name (symfile_name, psymbol_obstack);
+ result -> objfile = objfile;
result -> filename = create_name (filename, psymbol_obstack);
result -> textlow = textlow;
result -> texthigh = texthigh;
switch (dip -> dietag)
{
case TAG_global_subroutine:
- record_misc_function (dip -> at_name, dip -> at_low_pc);
+ record_misc_function (dip -> at_name, dip -> at_low_pc, mf_text);
add_psymbol_to_list (&global_psymbols, dip -> at_name, VAR_NAMESPACE,
LOC_BLOCK, dip -> at_low_pc);
break;
case TAG_global_variable:
+ record_misc_function (dip -> at_name, locval (dip -> at_location),
+ mf_data);
add_psymbol_to_list (&global_psymbols, dip -> at_name, VAR_NAMESPACE,
LOC_STATIC, 0);
break;
so, then extracting all the attributes info and generating a
partial symbol table entry.
+NOTES
+
+ Don't attempt to add anonymous structures, unions, or enumerations
+ since they have no name. Also, for variables and subroutines,
+ check that this is the place where the actual definition occurs,
+ rather than just a reference to an external.
+
*/
static void
switch (di.dietag)
{
case TAG_global_subroutine:
- case TAG_global_variable:
case TAG_subroutine:
+ case TAG_global_variable:
case TAG_local_variable:
+ completedieinfo (&di);
+ if (di.at_name && (di.has_at_low_pc || di.at_location))
+ {
+ add_partial_symbol (&di);
+ }
+ break;
case TAG_typedef:
case TAG_structure_type:
case TAG_union_type:
case TAG_enumeration_type:
completedieinfo (&di);
- /* Don't attempt to add anonymous structures, unions, or
- enumerations since they have no name. Also check that
- this is the place where the actual definition occurs,
- rather than just a reference to an external. */
- if (di.at_name != NULL && !di.at_is_external_p)
+ if (di.at_name)
{
add_partial_symbol (&di);
}
static void
DEFUN(scan_compilation_units,
- (filename, addr, thisdie, enddie, dbfoff, lnoffset),
+ (filename, addr, thisdie, enddie, dbfoff, lnoffset, objfile),
char *filename AND
CORE_ADDR addr AND
char *thisdie AND
char *enddie AND
unsigned int dbfoff AND
- unsigned int lnoffset)
+ unsigned int lnoffset AND
+ struct objfile *objfile)
{
char *nextdie;
struct dieinfo di;
}
curoff = thisdie - dbbase;
culength = nextdie - thisdie;
- curlnoffset = di.at_stmt_list_p ? lnoffset + di.at_stmt_list : 0;
- pst = start_psymtab (filename, addr, di.at_name,
+ curlnoffset = di.has_at_stmt_list ? lnoffset + di.at_stmt_list : 0;
+ pst = start_psymtab (objfile, addr, di.at_name,
di.at_low_pc, di.at_high_pc,
dbfoff, curoff, culength, curlnoffset,
global_psymbols.next,
/* Deduct the size of the fundamental type bytes at the end of the block. */
modcount -= sizeof (short);
/* Skip over the two size bytes at the beginning of the block. */
- modifiers = typedata + sizeof (short);
+ modifiers = (unsigned char *) typedata + sizeof (short);
/* Now do the actual decoding */
typep = decode_modified_type (modifiers, modcount, AT_mod_fund_type);
return (typep);
/* Deduct the size of the reference type bytes at the end of the block. */
modcount -= sizeof (long);
/* Skip over the two size bytes at the beginning of the block. */
- modifiers = typedata + sizeof (short);
+ modifiers = (unsigned char *) typedata + sizeof (short);
/* Now do the actual decoding */
typep = decode_modified_type (modifiers, modcount, AT_mod_u_d_type);
return (typep);
break;
case AT_stmt_list:
(void) memcpy (&dip -> at_stmt_list, diep, sizeof (long));
- dip -> at_stmt_list_p = 1;
+ dip -> has_at_stmt_list = 1;
break;
case AT_low_pc:
(void) memcpy (&dip -> at_low_pc, diep, sizeof (long));
+ dip -> has_at_low_pc = 1;
break;
case AT_high_pc:
(void) memcpy (&dip -> at_high_pc, diep, sizeof (long));
case AT_mod_u_d_type:
dip -> at_mod_u_d_type = diep;
break;
- case AT_deriv_list:
- dip -> at_deriv_list = diep;
- 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;
case AT_producer:
dip -> at_producer = diep;
break;
- case AT_loclist:
- (void) memcpy (&dip -> at_loclist, diep, sizeof (long));
- break;
case AT_frame_base:
(void) memcpy (&dip -> at_frame_base, diep, sizeof (long));
break;
- case AT_incomplete:
- (void) memcpy (&dip -> at_incomplete, diep, sizeof (short));
- break;
case AT_start_scope:
(void) memcpy (&dip -> at_start_scope, diep, sizeof (long));
break;
case AT_prototyped:
(void) memcpy (&dip -> at_prototyped, diep, sizeof (short));
break;
- case AT_const_data:
- dip -> at_const_data = diep;
- break;
- case AT_is_external:
- (void) memcpy (&dip -> at_is_external, diep, sizeof (short));
- dip -> at_is_external_p = 1;
- break;
default:
/* Found an attribute that we are unprepared to handle. However
it is specifically one of the design goals of DWARF that