From: Simon Marchi Date: Wed, 27 May 2020 15:13:57 +0000 (-0400) Subject: Add dwarf2_per_objfile parameter to create_partial_symtab X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7aa104c423d935656d81ba6612586e98ee9babb5;p=binutils-gdb.git Add dwarf2_per_objfile parameter to create_partial_symtab This allows removing a dwarf2_per_cu_data::dwarf2_per_objfile reference. gdb/ChangeLog: * dwarf2/read.c (create_partial_symtab): Add dwarf2_per_objfile parameter. (create_type_unit_group): Update. (process_psymtab_comp_unit_reader): Update. (build_type_psymtabs_reader): Update. Change-Id: I72e3a8fce8022943ce6992fb623e05636cd0e3a5 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e5f20d32272..1308acd068e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2020-05-27 Simon Marchi + + * dwarf2/read.c (create_partial_symtab): Add dwarf2_per_objfile + parameter. + (create_type_unit_group): Update. + (process_psymtab_comp_unit_reader): Update. + (build_type_psymtabs_reader): Update. + 2020-05-27 Simon Marchi * dwarf2/read.c (cutu_reader::keep): Access dwarf2_per_objfile diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index d58303098c1..3ca7772a469 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1204,7 +1204,8 @@ static void dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu); static dwarf2_psymtab *create_partial_symtab - (struct dwarf2_per_cu_data *per_cu, const char *name); + (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, + const char *name); static void build_type_psymtabs_reader (const struct die_reader_specs *reader, const gdb_byte *info_ptr, @@ -7331,7 +7332,7 @@ create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct) else name = string_printf ("", line_offset); - pst = create_partial_symtab (per_cu, name.c_str ()); + pst = create_partial_symtab (per_cu, dwarf2_per_objfile, name.c_str ()); pst->anonymous = true; } @@ -7405,9 +7406,11 @@ get_type_unit_group (struct dwarf2_cu *cu, const struct attribute *stmt_list) dirname, textlow, texthigh. */ static dwarf2_psymtab * -create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) +create_partial_symtab (dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile, + const char *name) { - struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile; + struct objfile *objfile = per_objfile->objfile; dwarf2_psymtab *pst; pst = new dwarf2_psymtab (name, objfile, per_cu); @@ -7429,7 +7432,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, enum language pretend_language) { struct dwarf2_cu *cu = reader->cu; - struct objfile *objfile = cu->per_objfile->objfile; + dwarf2_per_objfile *per_objfile = cu->per_objfile; + struct objfile *objfile = per_objfile->objfile; struct gdbarch *gdbarch = objfile->arch (); struct dwarf2_per_cu_data *per_cu = cu->per_cu; CORE_ADDR baseaddr; @@ -7456,7 +7460,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, filename = debug_filename.get (); } - pst = create_partial_symtab (per_cu, filename); + pst = create_partial_symtab (per_cu, per_objfile, filename); /* This must be done before calling dwarf2_build_include_psymtabs. */ pst->dirname = dwarf2_string_attr (comp_unit_die, DW_AT_comp_dir, cu); @@ -7637,7 +7641,7 @@ build_type_psymtabs_reader (const struct die_reader_specs *reader, tu_group->tus->push_back (sig_type); prepare_one_comp_unit (cu, type_unit_die, language_minimal); - pst = create_partial_symtab (per_cu, ""); + pst = create_partial_symtab (per_cu, dwarf2_per_objfile, ""); pst->anonymous = true; first_die = load_partial_dies (reader, info_ptr, 1);