GNU Binutils with patches for OS216
修订版 | d4ea1c4e01ffb02c4e748ec44605e99bf90fc464 (tree) |
---|---|
时间 | 2020-05-13 04:24:50 |
作者 | Simon Marchi <simon.marchi@effi...> |
Commiter | Simon Marchi |
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.
@@ -1204,7 +1204,8 @@ static void dwarf2_find_base_address (struct die_info *die, | ||
1204 | 1204 | struct dwarf2_cu *cu); |
1205 | 1205 | |
1206 | 1206 | static dwarf2_psymtab *create_partial_symtab |
1207 | - (struct dwarf2_per_cu_data *per_cu, const char *name); | |
1207 | + (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, | |
1208 | + const char *name); | |
1208 | 1209 | |
1209 | 1210 | static void build_type_psymtabs_reader (const struct die_reader_specs *reader, |
1210 | 1211 | const gdb_byte *info_ptr, |
@@ -7293,7 +7294,7 @@ create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct) | ||
7293 | 7294 | else |
7294 | 7295 | name = string_printf ("<type_units_at_0x%x>", line_offset); |
7295 | 7296 | |
7296 | - pst = create_partial_symtab (per_cu, name.c_str ()); | |
7297 | + pst = create_partial_symtab (per_cu, dwarf2_per_objfile, name.c_str ()); | |
7297 | 7298 | pst->anonymous = true; |
7298 | 7299 | } |
7299 | 7300 |
@@ -7367,9 +7368,11 @@ get_type_unit_group (struct dwarf2_cu *cu, const struct attribute *stmt_list) | ||
7367 | 7368 | dirname, textlow, texthigh. */ |
7368 | 7369 | |
7369 | 7370 | static dwarf2_psymtab * |
7370 | -create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) | |
7371 | +create_partial_symtab (dwarf2_per_cu_data *per_cu, | |
7372 | + dwarf2_per_objfile *per_objfile, | |
7373 | + const char *name) | |
7371 | 7374 | { |
7372 | - struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile; | |
7375 | + struct objfile *objfile = per_objfile->objfile; | |
7373 | 7376 | dwarf2_psymtab *pst; |
7374 | 7377 | |
7375 | 7378 | pst = new dwarf2_psymtab (name, objfile, per_cu); |
@@ -7391,7 +7394,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, | ||
7391 | 7394 | enum language pretend_language) |
7392 | 7395 | { |
7393 | 7396 | struct dwarf2_cu *cu = reader->cu; |
7394 | - struct objfile *objfile = cu->per_objfile->objfile; | |
7397 | + dwarf2_per_objfile *per_objfile = cu->per_objfile; | |
7398 | + struct objfile *objfile = per_objfile->objfile; | |
7395 | 7399 | struct gdbarch *gdbarch = objfile->arch (); |
7396 | 7400 | struct dwarf2_per_cu_data *per_cu = cu->per_cu; |
7397 | 7401 | CORE_ADDR baseaddr; |
@@ -7418,7 +7422,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, | ||
7418 | 7422 | filename = debug_filename.get (); |
7419 | 7423 | } |
7420 | 7424 | |
7421 | - pst = create_partial_symtab (per_cu, filename); | |
7425 | + pst = create_partial_symtab (per_cu, per_objfile, filename); | |
7422 | 7426 | |
7423 | 7427 | /* This must be done before calling dwarf2_build_include_psymtabs. */ |
7424 | 7428 | pst->dirname = dwarf2_string_attr (comp_unit_die, DW_AT_comp_dir, cu); |
@@ -7599,7 +7603,7 @@ build_type_psymtabs_reader (const struct die_reader_specs *reader, | ||
7599 | 7603 | tu_group->tus->push_back (sig_type); |
7600 | 7604 | |
7601 | 7605 | prepare_one_comp_unit (cu, type_unit_die, language_minimal); |
7602 | - pst = create_partial_symtab (per_cu, ""); | |
7606 | + pst = create_partial_symtab (per_cu, dwarf2_per_objfile, ""); | |
7603 | 7607 | pst->anonymous = true; |
7604 | 7608 | |
7605 | 7609 | first_die = load_partial_dies (reader, info_ptr, 1); |