aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2018-01-07 11:22:46 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2018-01-07 11:22:46 -0500
commit518817b361167ac91e7cdad8528b4d90cdc3fb26 (patch)
tree3c4f570abeba618114d86d655bb0b490957154e4
parented2dc618b3d2b0be01ffdf74c4c75504b707bcf1 (diff)
downloadgdb-518817b361167ac91e7cdad8528b4d90cdc3fb26.zip
gdb-518817b361167ac91e7cdad8528b4d90cdc3fb26.tar.gz
gdb-518817b361167ac91e7cdad8528b4d90cdc3fb26.tar.bz2
Remove dwarf2_cu::dwarf2_per_objfile
This patch removes the dwarf2_per_objfile field of dwarf2_cu. It is redundant, since we can access dwarf2_per_objfile through dwarf2_per_objfile, which is guaranteed to be set. gdb/ChangeLog: * dwarf2read.c (struct dwarf2_cu) <dwarf2_per_objfile>: Remove. (dw2_get_file_names_reader): Adjust. (lookup_dwo_signatured_type): Adjust. (lookup_dwp_signatured_type): Adjust. (lookup_signatured_type): Adjust. (create_type_unit_group): Adjust. (get_type_unit_group): Adjust. (process_psymtab_comp_unit_reader): Adjust. (build_type_psymtabs_reader): Adjust. (scan_partial_symbols): Adjust. (add_partial_symbol): Adjust. (add_partial_subprogram): Adjust. (peek_die_abbrev): Adjust. (fixup_go_packaging): Adjust. (process_imported_unit_die): Adjust. (dwarf2_compute_name): Adjust. (dwarf2_physname): Adjust. (read_import_statement): Adjust. (handle_DW_AT_stmt_list): Adjust. (read_file_scope): Adjust. (read_func_scope): Adjust. (read_lexical_block_scope): Adjust. (read_call_site_scope): Adjust. (read_variable): Adjust. (dwarf2_rnglists_process): Adjust. (dwarf2_ranges_process): Adjust. (dwarf2_ranges_read): Adjust. (dwarf2_get_pc_bounds): Adjust. (dwarf2_record_block_ranges): Adjust. (dwarf2_add_field): Adjust. (dwarf2_add_member_fn): Adjust. (read_structure_type): Adjust. (process_structure_scope): Adjust. (read_enumeration_type): Adjust. (read_array_type): Adjust. (mark_common_block_symbol_computed): Adjust. (read_common_block): Adjust. (read_namespace_type): Adjust. (read_namespace): Adjust. (read_module_type): Adjust. (read_tag_pointer_type): Adjust. (read_tag_ptr_to_member_type): Adjust. (read_tag_string_type): Adjust. (read_subroutine_type): Adjust. (read_typedef): Adjust. (read_base_type): Adjust. (attr_to_dynamic_prop): Adjust. (read_subrange_type): Adjust. (read_unspecified_type): Adjust. (dwarf2_read_abbrevs): Adjust. (load_partial_dies): Adjust. (read_partial_die): Adjust. (find_partial_die): Adjust. (guess_partial_die_structure_name): Adjust. (fixup_partial_die): Adjust. (read_attribute_value): Adjust. (read_addr_index): Adjust. (read_addr_index_from_leb128): Adjust. (read_str_index): Adjust. (dwarf2_string_attr): Adjust. (get_debug_line_section): Adjust. (dwarf_decode_line_header): Adjust. (lnp_state_machine::check_line_address): Adjust. (dwarf_decode_lines_1): Adjust. (dwarf_decode_lines): Adjust. (dwarf2_start_symtab): Adjust. (var_decode_location): Adjust. (new_symbol_full): Adjust. (dwarf2_const_value_data): Adjust. (dwarf2_const_value_attr): Adjust. (dwarf2_const_value): Adjust. (die_type): Adjust. (die_containing_type): Adjust. (build_error_marker_type): Adjust. (lookup_die_type): Adjust. (guess_full_die_structure_name): Adjust. (anonymous_struct_prefix): Adjust. (determine_prefix): Adjust. (dwarf2_name): Adjust. (follow_die_ref_or_sig): Adjust. (follow_die_offset): Adjust. (follow_die_ref): Adjust. (follow_die_sig_1): Adjust. (follow_die_sig): Adjust. (get_signatured_type): Adjust. (get_DW_AT_signature_type): Adjust. (decode_locdesc): Adjust. (dwarf_decode_macros): Adjust. (cu_debug_loc_section): Adjust. (fill_in_loclist_baton): Adjust. (dwarf2_symbol_mark_computed): Adjust. (init_one_comp_unit): Don't assign dwarf2_cu::dwarf2_per_objfile. (set_die_type): Adjust.
-rw-r--r--gdb/ChangeLog97
-rw-r--r--gdb/dwarf2read.c247
2 files changed, 237 insertions, 107 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7775af2..16b0f43 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,100 @@
+2018-01-07 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * dwarf2read.c (struct dwarf2_cu) <dwarf2_per_objfile>: Remove.
+ (dw2_get_file_names_reader): Adjust.
+ (lookup_dwo_signatured_type): Adjust.
+ (lookup_dwp_signatured_type): Adjust.
+ (lookup_signatured_type): Adjust.
+ (create_type_unit_group): Adjust.
+ (get_type_unit_group): Adjust.
+ (process_psymtab_comp_unit_reader): Adjust.
+ (build_type_psymtabs_reader): Adjust.
+ (scan_partial_symbols): Adjust.
+ (add_partial_symbol): Adjust.
+ (add_partial_subprogram): Adjust.
+ (peek_die_abbrev): Adjust.
+ (fixup_go_packaging): Adjust.
+ (process_imported_unit_die): Adjust.
+ (dwarf2_compute_name): Adjust.
+ (dwarf2_physname): Adjust.
+ (read_import_statement): Adjust.
+ (handle_DW_AT_stmt_list): Adjust.
+ (read_file_scope): Adjust.
+ (read_func_scope): Adjust.
+ (read_lexical_block_scope): Adjust.
+ (read_call_site_scope): Adjust.
+ (read_variable): Adjust.
+ (dwarf2_rnglists_process): Adjust.
+ (dwarf2_ranges_process): Adjust.
+ (dwarf2_ranges_read): Adjust.
+ (dwarf2_get_pc_bounds): Adjust.
+ (dwarf2_record_block_ranges): Adjust.
+ (dwarf2_add_field): Adjust.
+ (dwarf2_add_member_fn): Adjust.
+ (read_structure_type): Adjust.
+ (process_structure_scope): Adjust.
+ (read_enumeration_type): Adjust.
+ (read_array_type): Adjust.
+ (mark_common_block_symbol_computed): Adjust.
+ (read_common_block): Adjust.
+ (read_namespace_type): Adjust.
+ (read_namespace): Adjust.
+ (read_module_type): Adjust.
+ (read_tag_pointer_type): Adjust.
+ (read_tag_ptr_to_member_type): Adjust.
+ (read_tag_string_type): Adjust.
+ (read_subroutine_type): Adjust.
+ (read_typedef): Adjust.
+ (read_base_type): Adjust.
+ (attr_to_dynamic_prop): Adjust.
+ (read_subrange_type): Adjust.
+ (read_unspecified_type): Adjust.
+ (dwarf2_read_abbrevs): Adjust.
+ (load_partial_dies): Adjust.
+ (read_partial_die): Adjust.
+ (find_partial_die): Adjust.
+ (guess_partial_die_structure_name): Adjust.
+ (fixup_partial_die): Adjust.
+ (read_attribute_value): Adjust.
+ (read_addr_index): Adjust.
+ (read_addr_index_from_leb128): Adjust.
+ (read_str_index): Adjust.
+ (dwarf2_string_attr): Adjust.
+ (get_debug_line_section): Adjust.
+ (dwarf_decode_line_header): Adjust.
+ (lnp_state_machine::check_line_address): Adjust.
+ (dwarf_decode_lines_1): Adjust.
+ (dwarf_decode_lines): Adjust.
+ (dwarf2_start_symtab): Adjust.
+ (var_decode_location): Adjust.
+ (new_symbol_full): Adjust.
+ (dwarf2_const_value_data): Adjust.
+ (dwarf2_const_value_attr): Adjust.
+ (dwarf2_const_value): Adjust.
+ (die_type): Adjust.
+ (die_containing_type): Adjust.
+ (build_error_marker_type): Adjust.
+ (lookup_die_type): Adjust.
+ (guess_full_die_structure_name): Adjust.
+ (anonymous_struct_prefix): Adjust.
+ (determine_prefix): Adjust.
+ (dwarf2_name): Adjust.
+ (follow_die_ref_or_sig): Adjust.
+ (follow_die_offset): Adjust.
+ (follow_die_ref): Adjust.
+ (follow_die_sig_1): Adjust.
+ (follow_die_sig): Adjust.
+ (get_signatured_type): Adjust.
+ (get_DW_AT_signature_type): Adjust.
+ (decode_locdesc): Adjust.
+ (dwarf_decode_macros): Adjust.
+ (cu_debug_loc_section): Adjust.
+ (fill_in_loclist_baton): Adjust.
+ (dwarf2_symbol_mark_computed): Adjust.
+ (init_one_comp_unit): Don't assign
+ dwarf2_cu::dwarf2_per_objfile.
+ (set_die_type): Adjust.
+
2018-01-07 Simon Marchi <simon.marchi@ericsson.com>
* dwarf2read.c (struct mapped_debug_names): Add constructor.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ba56b45..1330c37 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -661,9 +661,6 @@ DEF_VEC_O (delayed_method_info);
/* Internal state when decoding a particular compilation unit. */
struct dwarf2_cu
{
- /* The dwarf2_per_objfile containing this compilation unit. */
- struct dwarf2_per_objfile *dwarf2_per_objfile;
-
/* The header of the compilation unit. */
struct comp_unit_head header;
@@ -3931,7 +3928,8 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
{
struct dwarf2_cu *cu = reader->cu;
struct dwarf2_per_cu_data *this_cu = cu->per_cu;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwarf2_per_cu_data *lh_cu;
struct attribute *attr;
@@ -7272,7 +7270,8 @@ fill_in_sig_entry_from_dwo_entry (struct dwarf2_per_objfile *dwarf2_per_objfile,
static struct signatured_type *
lookup_dwo_signatured_type (struct dwarf2_cu *cu, ULONGEST sig)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwo_file *dwo_file;
struct dwo_unit find_dwo_entry, *dwo_entry;
@@ -7341,7 +7340,8 @@ lookup_dwo_signatured_type (struct dwarf2_cu *cu, ULONGEST sig)
static struct signatured_type *
lookup_dwp_signatured_type (struct dwarf2_cu *cu, ULONGEST sig)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwp_file *dwp_file = get_dwp_file (dwarf2_per_objfile);
struct dwo_unit *dwo_entry;
@@ -7390,7 +7390,8 @@ lookup_dwp_signatured_type (struct dwarf2_cu *cu, ULONGEST sig)
static struct signatured_type *
lookup_signatured_type (struct dwarf2_cu *cu, ULONGEST sig)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
if (cu->dwo_unit
&& dwarf2_per_objfile->using_index)
@@ -8181,7 +8182,8 @@ allocate_type_unit_groups_table (struct objfile *objfile)
static struct type_unit_group *
create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwarf2_per_cu_data *per_cu;
struct type_unit_group *tu_group;
@@ -8189,7 +8191,7 @@ create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct)
tu_group = OBSTACK_ZALLOC (&objfile->objfile_obstack,
struct type_unit_group);
per_cu = &tu_group->per_cu;
- per_cu->dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ per_cu->dwarf2_per_objfile = dwarf2_per_objfile;
if (dwarf2_per_objfile->using_index)
{
@@ -8227,7 +8229,8 @@ create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct)
static struct type_unit_group *
get_type_unit_group (struct dwarf2_cu *cu, const struct attribute *stmt_list)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct tu_stats *tu_stats = &dwarf2_per_objfile->tu_stats;
struct type_unit_group *tu_group;
void **slot;
@@ -8332,7 +8335,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
void *data)
{
struct dwarf2_cu *cu = reader->cu;
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct dwarf2_per_cu_data *per_cu = cu->per_cu;
CORE_ADDR baseaddr;
@@ -8495,7 +8498,7 @@ build_type_psymtabs_reader (const struct die_reader_specs *reader,
void *data)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
- = reader->cu->dwarf2_per_objfile;
+ = reader->cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwarf2_cu *cu = reader->cu;
struct dwarf2_per_cu_data *per_cu = cu->per_cu;
@@ -9114,12 +9117,12 @@ scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc,
{
error (_("Dwarf Error: DW_TAG_imported_unit is not"
" supported in type units [in module %s]"),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
}
per_cu = dwarf2_find_containing_comp_unit
(pdi->d.sect_off, pdi->is_dwz,
- cu->dwarf2_per_objfile);
+ cu->per_cu->dwarf2_per_objfile);
/* Go read the partial unit, if needed. */
if (per_cu->v.psymtab == NULL)
@@ -9281,7 +9284,8 @@ partial_die_full_name (struct partial_die_info *pdi,
static void
add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
CORE_ADDR addr = 0;
@@ -9524,7 +9528,7 @@ add_partial_subprogram (struct partial_die_info *pdi,
*highpc = pdi->highpc;
if (set_addrmap)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
CORE_ADDR baseaddr;
CORE_ADDR highpc;
@@ -9610,7 +9614,7 @@ static struct abbrev_info *
peek_die_abbrev (const gdb_byte *info_ptr, unsigned int *bytes_read,
struct dwarf2_cu *cu)
{
- bfd *abfd = cu->dwarf2_per_objfile->objfile->obfd;
+ bfd *abfd = cu->per_cu->dwarf2_per_objfile->objfile->obfd;
unsigned int abbrev_number;
struct abbrev_info *abbrev;
@@ -10279,7 +10283,8 @@ fixup_go_packaging (struct dwarf2_cu *cu)
package_name = this_package_name;
else
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile
+ = cu->per_cu->dwarf2_per_objfile->objfile;
if (strcmp (package_name, this_package_name) != 0)
complaint (&symfile_complaints,
_("Symtab %s has objects from two different Go packages: %s and %s"),
@@ -10296,7 +10301,7 @@ fixup_go_packaging (struct dwarf2_cu *cu)
if (package_name != NULL)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
const char *saved_package_name
= (const char *) obstack_copy0 (&objfile->per_bfd->storage_obstack,
package_name,
@@ -10657,7 +10662,7 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
{
error (_("Dwarf Error: DW_TAG_imported_unit is not"
" supported in type units [in module %s]"),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
}
attr = dwarf2_attr (die, DW_AT_import, cu);
@@ -10667,7 +10672,7 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
bool is_dwz = (attr->form == DW_FORM_GNU_ref_alt || cu->per_cu->is_dwz);
dwarf2_per_cu_data *per_cu
= dwarf2_find_containing_comp_unit (sect_off, is_dwz,
- cu->dwarf2_per_objfile);
+ cu->per_cu->dwarf2_per_objfile);
/* If necessary, add it to the queue and load its DIEs. */
if (maybe_queue_comp_unit (cu, per_cu, cu->language))
@@ -10924,7 +10929,7 @@ dwarf2_compute_name (const char *name,
struct die_info *die, struct dwarf2_cu *cu,
int physname)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
if (name == NULL)
name = dwarf2_name (die, cu);
@@ -11173,7 +11178,7 @@ dwarf2_full_name (const char *name, struct die_info *die, struct dwarf2_cu *cu)
static const char *
dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
const char *retval, *mangled = NULL, *canon = NULL;
int need_copy = 1;
@@ -11347,7 +11352,7 @@ using_directives (enum language language)
static void
read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct attribute *import_attr;
struct die_info *imported_die, *child_die;
struct dwarf2_cu *imported_cu;
@@ -11554,7 +11559,8 @@ static void
handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
const char *comp_dir, CORE_ADDR lowpc) /* ARI: editCase function */
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct attribute *attr;
struct line_header line_header_local;
@@ -11653,7 +11659,8 @@ handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
static void
read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
CORE_ADDR lowpc = ((CORE_ADDR) -1);
@@ -13799,7 +13806,7 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu)
static void
read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct context_stack *newobj;
CORE_ADDR lowpc;
@@ -13990,7 +13997,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
static void
read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct context_stack *newobj;
CORE_ADDR lowpc, highpc;
@@ -14061,7 +14068,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
static void
read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
CORE_ADDR pc, baseaddr;
struct attribute *attr;
@@ -14215,7 +14222,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *target_die;
target_die = follow_die_ref (die, attr, &target_cu);
- gdb_assert (target_cu->dwarf2_per_objfile->objfile == objfile);
+ gdb_assert (target_cu->per_cu->dwarf2_per_objfile->objfile == objfile);
if (die_is_declaration (target_die, target_cu))
{
const char *target_physname;
@@ -14417,7 +14424,7 @@ read_variable (struct die_info *die, struct dwarf2_cu *cu)
if (containing_type != NULL)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
storage = OBSTACK_ZALLOC (&objfile->objfile_obstack,
struct rust_vtable_symbol);
@@ -14443,7 +14450,7 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
Callback &&callback)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
- = cu->dwarf2_per_objfile;
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
bfd *obfd = objfile->obfd;
/* Base address selection entry. */
@@ -14611,7 +14618,7 @@ dwarf2_ranges_process (unsigned offset, struct dwarf2_cu *cu,
Callback &&callback)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
- = cu->dwarf2_per_objfile;
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct comp_unit_head *cu_header = &cu->header;
bfd *obfd = objfile->obfd;
@@ -14719,7 +14726,7 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
CORE_ADDR *high_return, struct dwarf2_cu *cu,
struct partial_symtab *ranges_pst)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
const CORE_ADDR baseaddr = ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile));
@@ -14786,7 +14793,8 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
CORE_ADDR *highpc, struct dwarf2_cu *cu,
struct partial_symtab *pst)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct attribute *attr;
struct attribute *attr_high;
CORE_ADDR low = 0;
@@ -14961,7 +14969,7 @@ static void
dwarf2_record_block_ranges (struct die_info *die, struct block *block,
CORE_ADDR baseaddr, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct attribute *attr;
struct attribute *attr_high;
@@ -15145,7 +15153,7 @@ static void
dwarf2_add_field (struct field_info *fip, struct die_info *die,
struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct nextfield *new_field;
struct attribute *attr;
@@ -15544,7 +15552,7 @@ static void
dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
struct type *type, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct attribute *attr;
struct fnfieldlist *flp;
int i;
@@ -15856,7 +15864,7 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile)
static struct type *
read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct type *type;
struct attribute *attr;
const char *name;
@@ -15979,7 +15987,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
static void
process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct die_info *child_die;
struct type *type;
@@ -16279,7 +16287,7 @@ update_enumeration_type_from_children (struct die_info *die,
static struct type *
read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct type *type;
struct attribute *attr;
const char *name;
@@ -16451,7 +16459,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
read_array_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct die_info *child_die;
struct type *type;
struct type *element_type, *range_type, *index_type;
@@ -16481,7 +16489,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
_("unable to read array DW_AT_byte_stride "
" - DIE at 0x%x [in module %s]"),
to_underlying (die->sect_off),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
/* Ignore this attribute. We will likely not be able to print
arrays of this type correctly, but there is little we can do
to help if we cannot read the attribute's value. */
@@ -16654,7 +16662,8 @@ mark_common_block_symbol_computed (struct symbol *sym,
struct attribute *member_loc,
struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwarf2_locexpr_baton *baton;
gdb_byte *ptr;
@@ -16744,7 +16753,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
if (die->child != NULL)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct die_info *child_die;
size_t n_entries = 0, size;
struct common_block *common_block;
@@ -16789,7 +16798,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
"DW_AT_data_member_location "
"- DIE at 0x%x [in module %s]"),
to_underlying (child_die->sect_off),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (objfile));
if (attr_form_is_section_offset (member_loc))
dwarf2_complex_location_expr_complaint ();
@@ -16816,7 +16825,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
read_namespace_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
const char *previous_prefix, *name;
int is_anonymous;
struct type *type;
@@ -16856,7 +16865,7 @@ read_namespace_type (struct die_info *die, struct dwarf2_cu *cu)
static void
read_namespace (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
int is_anonymous;
/* Add a symbol associated to this if we haven't seen the namespace
@@ -16901,7 +16910,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
read_module_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
const char *module_name;
struct type *type;
@@ -16975,7 +16984,8 @@ namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *cu)
static struct type *
read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct gdbarch *gdbarch = get_objfile_arch (cu->dwarf2_per_objfile->objfile);
+ struct gdbarch *gdbarch
+ = get_objfile_arch (cu->per_cu->dwarf2_per_objfile->objfile);
struct comp_unit_head *cu_header = &cu->header;
struct type *type;
struct attribute *attr_byte_size;
@@ -17056,7 +17066,8 @@ read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu)
type = lookup_methodptr_type (to_type);
else if (TYPE_CODE (check_typedef (to_type)) == TYPE_CODE_FUNC)
{
- struct type *new_type = alloc_type (cu->dwarf2_per_objfile->objfile);
+ struct type *new_type
+ = alloc_type (cu->per_cu->dwarf2_per_objfile->objfile);
smash_to_method_type (new_type, domain, TYPE_TARGET_TYPE (to_type),
TYPE_FIELDS (to_type), TYPE_NFIELDS (to_type),
@@ -17219,7 +17230,7 @@ read_tag_atomic_type (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct type *type, *range_type, *index_type, *char_type;
struct attribute *attr;
@@ -17297,7 +17308,7 @@ prototyped_function_p (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct type *type; /* Type that this function returns. */
struct type *ftype; /* Function that returns above type. */
struct attribute *attr;
@@ -17434,7 +17445,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
read_typedef (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
const char *name = NULL;
struct type *this_type, *target_type;
@@ -17485,7 +17496,7 @@ dwarf2_init_float_type (struct objfile *objfile, int bits, const char *name,
static struct type *
read_base_type (struct die_info *die, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct type *type;
struct attribute *attr;
int encoding = 0, bits = 0;
@@ -17597,7 +17608,8 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
struct dwarf2_cu *cu, struct dynamic_prop *prop)
{
struct dwarf2_property_baton *baton;
- struct obstack *obstack = &cu->dwarf2_per_objfile->objfile->objfile_obstack;
+ struct obstack *obstack
+ = &cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack;
if (attr == NULL || prop == NULL)
return 0;
@@ -17759,7 +17771,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
"- DIE at 0x%x [in module %s]"),
to_underlying (die->sect_off),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
if (!attr_to_dynamic_prop (attr, die, cu, &high))
@@ -17789,7 +17801,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
high bound or count are not yet handled by this code. */
if (TYPE_CODE (base_type) == TYPE_CODE_VOID)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
int addr_size = gdbarch_addr_bit (gdbarch) /8;
struct type *int_type = objfile_type (objfile)->builtin_int;
@@ -17859,7 +17871,8 @@ read_unspecified_type (struct die_info *die, struct dwarf2_cu *cu)
{
struct type *type;
- type = init_type (cu->dwarf2_per_objfile->objfile, TYPE_CODE_VOID, 0, NULL);
+ type = init_type (cu->per_cu->dwarf2_per_objfile->objfile, TYPE_CODE_VOID,0,
+ NULL);
TYPE_NAME (type) = dwarf2_name (die, cu);
/* In Ada, an unspecified type is typically used when the description
@@ -18253,7 +18266,7 @@ dwarf2_read_abbrevs (struct dwarf2_cu *cu,
struct dwarf2_section_info *abbrev_section)
{
cu->abbrev_table =
- abbrev_table_read_table (cu->dwarf2_per_objfile, abbrev_section,
+ abbrev_table_read_table (cu->per_cu->dwarf2_per_objfile, abbrev_section,
cu->header.abbrev_sect_off);
}
@@ -18310,7 +18323,7 @@ load_partial_dies (const struct die_reader_specs *reader,
const gdb_byte *info_ptr, int building_psymtab)
{
struct dwarf2_cu *cu = reader->cu;
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct partial_die_info *part_die;
struct partial_die_info *parent_die, *last_die, *first_die = NULL;
struct abbrev_info *abbrev;
@@ -18587,7 +18600,8 @@ read_partial_die (const struct die_reader_specs *reader,
const gdb_byte *info_ptr)
{
struct dwarf2_cu *cu = reader->cu;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
const gdb_byte *buffer = reader->buffer;
unsigned int i;
@@ -18825,7 +18839,8 @@ find_partial_die_in_comp_unit (sect_offset sect_off, struct dwarf2_cu *cu)
static struct partial_die_info *
find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwarf2_per_cu_data *per_cu = NULL;
struct partial_die_info *pd = NULL;
@@ -18927,7 +18942,7 @@ guess_partial_die_structure_name (struct partial_die_info *struct_pdi,
child_pdi->linkage_name);
if (actual_class_name != NULL)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct_pdi->name
= ((const char *)
obstack_copy0 (&objfile->per_bfd->storage_obstack,
@@ -18984,7 +18999,8 @@ fixup_partial_die (struct partial_die_info *part_die,
children, see if we can determine the namespace from their linkage
name. */
if (cu->language == language_cplus
- && !VEC_empty (dwarf2_section_info_def, cu->dwarf2_per_objfile->types)
+ && !VEC_empty (dwarf2_section_info_def,
+ cu->per_cu->dwarf2_per_objfile->types)
&& part_die->die_parent == NULL
&& part_die->has_children
&& (part_die->tag == DW_TAG_class_type
@@ -19016,7 +19032,7 @@ fixup_partial_die (struct partial_die_info *part_die,
else
base = demangled;
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
part_die->name
= ((const char *)
obstack_copy0 (&objfile->per_bfd->storage_obstack,
@@ -19036,7 +19052,8 @@ read_attribute_value (const struct die_reader_specs *reader,
LONGEST implicit_const, const gdb_byte *info_ptr)
{
struct dwarf2_cu *cu = reader->cu;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
bfd *abfd = reader->abfd;
@@ -19737,8 +19754,8 @@ read_addr_index_1 (struct dwarf2_per_objfile *dwarf2_per_objfile,
static CORE_ADDR
read_addr_index (struct dwarf2_cu *cu, unsigned int addr_index)
{
- return read_addr_index_1 (cu->dwarf2_per_objfile, addr_index, cu->addr_base,
- cu->header.addr_size);
+ return read_addr_index_1 (cu->per_cu->dwarf2_per_objfile, addr_index,
+ cu->addr_base, cu->header.addr_size);
}
/* Given a pointer to an leb128 value, fetch the value from .debug_addr. */
@@ -19747,7 +19764,7 @@ static CORE_ADDR
read_addr_index_from_leb128 (struct dwarf2_cu *cu, const gdb_byte *info_ptr,
unsigned int *bytes_read)
{
- bfd *abfd = cu->dwarf2_per_objfile->objfile->obfd;
+ bfd *abfd = cu->per_cu->dwarf2_per_objfile->objfile->obfd;
unsigned int addr_index = read_unsigned_leb128 (abfd, info_ptr, bytes_read);
return read_addr_index (cu, addr_index);
@@ -19838,7 +19855,8 @@ static const char *
read_str_index (const struct die_reader_specs *reader, ULONGEST str_index)
{
struct dwarf2_cu *cu = reader->cu;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
const char *objf_name = objfile_name (objfile);
bfd *abfd = objfile->obfd;
@@ -20021,7 +20039,7 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c
_("string type expected for attribute %s for "
"DIE at 0x%x in module %s"),
dwarf_attr_name (name), to_underlying (die->sect_off),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
}
return str;
@@ -20113,7 +20131,8 @@ static struct dwarf2_section_info *
get_debug_line_section (struct dwarf2_cu *cu)
{
struct dwarf2_section_info *section;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
/* For TUs in DWO files, the DW_AT_stmt_list attribute lives in the
DWO file. */
@@ -20280,7 +20299,8 @@ dwarf_decode_line_header (sect_offset sect_off, struct dwarf2_cu *cu)
const char *cur_dir, *cur_file;
struct dwarf2_section_info *section;
bfd *abfd;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
section = get_debug_line_section (cu);
dwarf2_read_section (dwarf2_per_objfile->objfile, section);
@@ -20913,7 +20933,7 @@ lnp_state_machine::check_line_address (struct dwarf2_cu *cu,
/* This line table is for a function which has been
GCd by the linker. Ignore it. PR gdb/12528 */
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
long line_offset = line_ptr - get_debug_line_section (cu)->buffer;
complaint (&symfile_complaints,
@@ -20939,7 +20959,7 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
unsigned int bytes_read, extended_len;
unsigned char op_code, extended_op;
CORE_ADDR baseaddr;
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
bfd *abfd = objfile->obfd;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
/* True if we're recording line info (as opposed to building partial
@@ -21170,7 +21190,7 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
struct dwarf2_cu *cu, struct partial_symtab *pst,
CORE_ADDR lowpc, int decode_mapping)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
const int decode_for_pst_p = (pst != NULL);
if (decode_mapping)
@@ -21270,8 +21290,8 @@ dwarf2_start_symtab (struct dwarf2_cu *cu,
const char *name, const char *comp_dir, CORE_ADDR low_pc)
{
struct compunit_symtab *cust
- = start_symtab (cu->dwarf2_per_objfile->objfile, name, comp_dir, low_pc,
- cu->language);
+ = start_symtab (cu->per_cu->dwarf2_per_objfile->objfile, name, comp_dir,
+ low_pc, cu->language);
record_debugformat ("DWARF 2");
record_producer (cu->producer);
@@ -21288,7 +21308,7 @@ static void
var_decode_location (struct attribute *attr, struct symbol *sym,
struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct comp_unit_head *cu_header = &cu->header;
/* NOTE drow/2003-01-30: There used to be a comment and some special
@@ -21361,7 +21381,8 @@ static struct symbol *
new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
struct symbol *space)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct symbol *sym = NULL;
@@ -21760,7 +21781,7 @@ static gdb_byte *
dwarf2_const_value_data (const struct attribute *attr, struct obstack *obstack,
struct dwarf2_cu *cu, LONGEST *value, int bits)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
enum bfd_endian byte_order = bfd_big_endian (objfile->obfd) ?
BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
LONGEST l = DW_UNSND (attr);
@@ -21795,7 +21816,7 @@ dwarf2_const_value_attr (const struct attribute *attr, struct type *type,
LONGEST *value, const gdb_byte **bytes,
struct dwarf2_locexpr_baton **baton)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct comp_unit_head *cu_header = &cu->header;
struct dwarf_block *blk;
enum bfd_endian byte_order = (bfd_big_endian (objfile->obfd) ?
@@ -21897,7 +21918,7 @@ static void
dwarf2_const_value (const struct attribute *attr, struct symbol *sym,
struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
LONGEST value;
const gdb_byte *bytes;
struct dwarf2_locexpr_baton *baton;
@@ -21934,8 +21955,9 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
type_attr = dwarf2_attr (die, DW_AT_type, cu);
if (!type_attr)
{
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
/* A missing DW_AT_type represents a void type. */
- return objfile_type (cu->dwarf2_per_objfile->objfile)->builtin_void;
+ return objfile_type (objfile)->builtin_void;
}
return lookup_die_type (die, type_attr, cu);
@@ -21998,11 +22020,12 @@ static struct type *
die_containing_type (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *type_attr;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
type_attr = dwarf2_attr (die, DW_AT_containing_type, cu);
if (!type_attr)
error (_("Dwarf Error: Problem turning containing type into gdb type "
- "[in module %s]"), objfile_name (cu->dwarf2_per_objfile->objfile));
+ "[in module %s]"), objfile_name (objfile));
return lookup_die_type (die, type_attr, cu);
}
@@ -22012,7 +22035,8 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu)
static struct type *
build_error_marker_type (struct dwarf2_cu *cu, struct die_info *die)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
char *message, *saved;
@@ -22036,7 +22060,8 @@ static struct type *
lookup_die_type (struct die_info *die, const struct attribute *attr,
struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct type *this_type;
@@ -22221,7 +22246,7 @@ guess_full_die_structure_name (struct die_info *die, struct dwarf2_cu *cu)
struct die_info *spec_die;
struct dwarf2_cu *spec_cu;
struct die_info *child;
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
spec_cu = cu;
spec_die = die_specification (die, &spec_cu);
@@ -22305,7 +22330,7 @@ anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu)
if (base == NULL || base == DW_STRING (attr) || base[-1] != ':')
return "";
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
return (char *) obstack_copy0 (&objfile->per_bfd->storage_obstack,
DW_STRING (attr),
&base[-1] - DW_STRING (attr));
@@ -22329,7 +22354,8 @@ anonymous_struct_prefix (struct die_info *die, struct dwarf2_cu *cu)
static const char *
determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct die_info *parent, *spec_die;
struct dwarf2_cu *spec_cu;
struct type *parent_type;
@@ -22575,7 +22601,7 @@ static const char *
dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
{
struct attribute *attr;
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
attr = dwarf2_attr (die, DW_AT_name, cu);
if ((!attr || !DW_STRING (attr))
@@ -22996,7 +23022,7 @@ follow_die_ref_or_sig (struct die_info *src_die, const struct attribute *attr,
{
dump_die_for_error (src_die);
error (_("Dwarf Error: Expected reference attribute [in module %s]"),
- objfile_name ((*ref_cu)->dwarf2_per_objfile->objfile));
+ objfile_name ((*ref_cu)->per_cu->dwarf2_per_objfile->objfile));
}
return die;
@@ -23013,7 +23039,8 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz,
{
struct die_info temp_die;
struct dwarf2_cu *target_cu, *cu = *ref_cu;
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
gdb_assert (cu->per_cu != NULL);
@@ -23076,7 +23103,7 @@ follow_die_ref (struct die_info *src_die, const struct attribute *attr,
error (_("Dwarf Error: Cannot find DIE at 0x%x referenced from DIE "
"at 0x%x [in module %s]"),
to_underlying (sect_off), to_underlying (src_die->sect_off),
- objfile_name (cu->dwarf2_per_objfile->objfile));
+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
return die;
}
@@ -23385,7 +23412,7 @@ follow_die_sig_1 (struct die_info *src_die, struct signatured_type *sig_type,
if (die)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
- = (*ref_cu)->dwarf2_per_objfile;
+ = (*ref_cu)->per_cu->dwarf2_per_objfile;
/* For .gdb_index version 7 keep track of included TUs.
http://sourceware.org/bugzilla/show_bug.cgi?id=15021. */
@@ -23428,7 +23455,7 @@ follow_die_sig (struct die_info *src_die, const struct attribute *attr,
error (_("Dwarf Error: Cannot find signatured DIE %s referenced"
" from DIE at 0x%x [in module %s]"),
hex_string (signature), to_underlying (src_die->sect_off),
- objfile_name ((*ref_cu)->dwarf2_per_objfile->objfile));
+ objfile_name ((*ref_cu)->per_cu->dwarf2_per_objfile->objfile));
}
die = follow_die_sig_1 (src_die, sig_type, ref_cu);
@@ -23438,7 +23465,7 @@ follow_die_sig (struct die_info *src_die, const struct attribute *attr,
error (_("Dwarf Error: Problem reading signatured DIE %s referenced"
" from DIE at 0x%x [in module %s]"),
hex_string (signature), to_underlying (src_die->sect_off),
- objfile_name ((*ref_cu)->dwarf2_per_objfile->objfile));
+ objfile_name ((*ref_cu)->per_cu->dwarf2_per_objfile->objfile));
}
return die;
@@ -23451,7 +23478,8 @@ static struct type *
get_signatured_type (struct die_info *die, ULONGEST signature,
struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct signatured_type *sig_type;
struct dwarf2_cu *type_cu;
struct die_info *type_die;
@@ -23527,7 +23555,8 @@ get_DW_AT_signature_type (struct die_info *die, const struct attribute *attr,
}
else
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
complaint (&symfile_complaints,
_("Dwarf Error: DW_AT_signature has bad form %s in DIE"
@@ -23639,7 +23668,7 @@ read_signatured_type (struct signatured_type *sig_type)
static CORE_ADDR
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
{
- struct objfile *objfile = cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
size_t i;
size_t size = blk->size;
const gdb_byte *data = blk->data;
@@ -24630,7 +24659,8 @@ static void
dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
int section_is_gnu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct line_header *lh = cu->line_header;
bfd *abfd;
@@ -24913,7 +24943,8 @@ attr_form_is_ref (const struct attribute *attr)
static struct dwarf2_section_info *
cu_debug_loc_section (struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
if (cu->dwo_unit)
{
@@ -24932,7 +24963,8 @@ fill_in_loclist_baton (struct dwarf2_cu *cu,
struct dwarf2_loclist_baton *baton,
const struct attribute *attr)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct dwarf2_section_info *section = cu_debug_loc_section (cu);
dwarf2_read_section (dwarf2_per_objfile->objfile, section);
@@ -24951,7 +24983,8 @@ static void
dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
struct dwarf2_cu *cu, int is_block)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct dwarf2_section_info *section = cu_debug_loc_section (cu);
@@ -25172,7 +25205,6 @@ init_one_comp_unit (struct dwarf2_cu *cu, struct dwarf2_per_cu_data *per_cu)
memset (cu, 0, sizeof (*cu));
per_cu->cu = cu;
cu->per_cu = per_cu;
- cu->dwarf2_per_objfile = per_cu->dwarf2_per_objfile;
obstack_init (&cu->comp_unit_obstack);
}
@@ -25395,7 +25427,8 @@ per_cu_offset_and_type_eq (const void *item_lhs, const void *item_rhs)
static struct type *
set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
{
- struct dwarf2_per_objfile *dwarf2_per_objfile = cu->dwarf2_per_objfile;
+ struct dwarf2_per_objfile *dwarf2_per_objfile
+ = cu->per_cu->dwarf2_per_objfile;
struct dwarf2_per_cu_offset_and_type **slot, ofs;
struct objfile *objfile = dwarf2_per_objfile->objfile;
struct attribute *attr;