From: Fred Fish Date: Mon, 18 Nov 1991 08:07:43 +0000 (+0000) Subject: Changes to match new DWARF draft 5 version of include/dwarf.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d6186f4faf6f2072b3a912f7d206dcdfac263ef;p=binutils-gdb.git Changes to match new DWARF draft 5 version of include/dwarf.h. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a2be86b181f..69f7e447c93 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Mon Nov 18 00:04:41 1991 Fred Fish (fnf at cygnus.com) + + * dwarfread.c: Changes to match new dwarf.h. Remove + AT_deriv_list, AT_loclist, AT_incomplete, AT_const_data, + and AT_is_external. + Sun Nov 17 16:20:53 1991 Michael Tiemann (tiemann at rtl.cygnus.com) * symtab.h (struct type): Moved C++-specific fields into new type diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 0f96332fe87..98cb95b594b 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -127,7 +127,7 @@ extern int info_verbose; /* From main.c; nonzero => verbose */ Some fields have a flag _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. */ @@ -152,7 +152,6 @@ struct dieinfo { 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; @@ -166,17 +165,13 @@ struct dieinfo { 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; }; static int diecount; /* Approximate count of dies for compilation unit */ @@ -1557,7 +1552,7 @@ DEFUN(process_dies, (thisdie, enddie, 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, objfile); } @@ -2682,6 +2677,13 @@ DESCRIPTION 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 @@ -2703,19 +2705,21 @@ DEFUN(scan_partial_symbols, (thisdie, enddie), char *thisdie AND char *enddie) 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); } @@ -2811,7 +2815,7 @@ DEFUN(scan_compilation_units, } curoff = thisdie - dbbase; culength = nextdie - thisdie; - curlnoffset = di.at_stmt_list_p ? lnoffset + di.at_stmt_list : 0; + 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, @@ -3420,10 +3424,11 @@ DEFUN(completedieinfo, (dip), struct dieinfo *dip) 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)); @@ -3461,9 +3466,6 @@ DEFUN(completedieinfo, (dip), struct dieinfo *dip) 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; break; @@ -3482,15 +3484,9 @@ DEFUN(completedieinfo, (dip), struct dieinfo *dip) 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; @@ -3503,13 +3499,6 @@ DEFUN(completedieinfo, (dip), struct dieinfo *dip) 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