diff options
author | Doug Evans <dje@google.com> | 2012-07-10 01:05:06 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-07-10 01:05:06 +0000 |
commit | 6721b2ec995b983abc98246ec3fdd0ade806907d (patch) | |
tree | ab68fa257abad5207268d51be0198f34c4cc15eb /gdb/dwarf2read.c | |
parent | cf69f73f0ff33ca47a67cb6343710c9c376fe507 (diff) | |
download | gdb-6721b2ec995b983abc98246ec3fdd0ade806907d.zip gdb-6721b2ec995b983abc98246ec3fdd0ade806907d.tar.gz gdb-6721b2ec995b983abc98246ec3fdd0ade806907d.tar.bz2 |
* dwarf2read.c (load_full_type_unit): Simplify.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 746bdfa..8f88825 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -15513,27 +15513,18 @@ lookup_signatured_type_at_offset (struct objfile *objfile, static void load_full_type_unit (struct dwarf2_per_cu_data *per_cu) { - struct objfile *objfile = per_cu->objfile; - struct dwarf2_section_info *sect = per_cu->info_or_types_section; - sect_offset offset = per_cu->offset; struct signatured_type *sig_type; - dwarf2_read_section (objfile, sect); - - /* We have the section offset, but we need the signature to do the - hash table lookup. */ - /* FIXME: This is sorta unnecessary, read_signatured_type only uses - the signature to assert we found the right one. - Ok, but it's a lot of work. We should simplify things so any needed - assert doesn't require all this clumsiness. */ - sig_type = lookup_signatured_type_at_offset (objfile, sect, offset); + /* We have the per_cu, but we need the signatured_type. + Fortunately this is an easy translation. */ + gdb_assert (per_cu->is_debug_types); + sig_type = (struct signatured_type *) per_cu; - gdb_assert (&sig_type->per_cu == per_cu); - gdb_assert (sig_type->per_cu.cu == NULL); + gdb_assert (per_cu->cu == NULL); read_signatured_type (sig_type); - gdb_assert (sig_type->per_cu.cu != NULL); + gdb_assert (per_cu->cu != NULL); } /* die_reader_func for read_signatured_type. |