diff options
author | Doug Evans <dje@google.com> | 2013-04-01 23:17:40 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2013-04-01 23:17:40 +0000 |
commit | c0f78cd41b0816f2e58aa2b27ab97b441775b07a (patch) | |
tree | 3eeb6c92e334126422304d5185726121bd955ad1 /gdb | |
parent | c4313823bd19a4c3e90ab437d8e8a53643161ffa (diff) | |
download | gdb-c0f78cd41b0816f2e58aa2b27ab97b441775b07a.zip gdb-c0f78cd41b0816f2e58aa2b27ab97b441775b07a.tar.gz gdb-c0f78cd41b0816f2e58aa2b27ab97b441775b07a.tar.bz2 |
* dwarf2read.c (lookup_signatured_type_at_offset): Delete.
(process_enumeration_scope): Simplify.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 3 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 37 |
2 files changed, 4 insertions, 36 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e761dbb..05cb097 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2013-04-01 Doug Evans <dje@google.com> + * dwarf2read.c (lookup_signatured_type_at_offset): Delete. + (process_enumeration_scope): Simplify. + * dwarf2read.c (struct dwarf2_per_cu_data): Move member type_unit_group ... (struct signatured_type): ... to here. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b61101e..953eb72 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1602,10 +1602,6 @@ static struct die_info *follow_die_sig (struct die_info *, struct attribute *, struct dwarf2_cu **); -static struct signatured_type *lookup_signatured_type_at_offset - (struct objfile *objfile, - struct dwarf2_section_info *section, sect_offset offset); - static void load_full_type_unit (struct dwarf2_per_cu_data *per_cu); static void read_signatured_type (struct signatured_type *); @@ -11809,10 +11805,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) { struct signatured_type *sig_type; - sig_type - = lookup_signatured_type_at_offset (dwarf2_per_objfile->objfile, - cu->per_cu->section, - cu->per_cu->offset); + sig_type = (struct signatured_type *) cu->per_cu; gdb_assert (sig_type->type_offset_in_section.sect_off != 0); if (sig_type->type_offset_in_section.sect_off != die->offset.sect_off) return; @@ -17763,34 +17756,6 @@ follow_die_sig (struct die_info *src_die, struct attribute *attr, temp_die.offset.sect_off, src_die->offset.sect_off, objfile->name); } -/* Given an offset of a signatured type, return its signatured_type. */ - -static struct signatured_type * -lookup_signatured_type_at_offset (struct objfile *objfile, - struct dwarf2_section_info *section, - sect_offset offset) -{ - gdb_byte *info_ptr = section->buffer + offset.sect_off; - unsigned int length, initial_length_size; - unsigned int sig_offset; - struct signatured_type find_entry, *sig_type; - - length = read_initial_length (objfile->obfd, info_ptr, &initial_length_size); - sig_offset = (initial_length_size - + 2 /*version*/ - + (initial_length_size == 4 ? 4 : 8) /*debug_abbrev_offset*/ - + 1 /*address_size*/); - find_entry.signature = bfd_get_64 (objfile->obfd, info_ptr + sig_offset); - sig_type = htab_find (dwarf2_per_objfile->signatured_types, &find_entry); - - /* This is only used to lookup previously recorded types. - If we didn't find it, it's our bug. */ - gdb_assert (sig_type != NULL); - gdb_assert (offset.sect_off == sig_type->per_cu.offset.sect_off); - - return sig_type; -} - /* Load the DIEs associated with type unit PER_CU into memory. */ static void |