diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-27 11:13:58 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-27 11:15:55 -0400 |
commit | 43182c09c6f90ebd46c3980e788c751efda8b1a9 (patch) | |
tree | dac9967e3eeb50b77974c1b4916542405da2de0e /gdb | |
parent | 7aa104c423d935656d81ba6612586e98ee9babb5 (diff) | |
download | gdb-43182c09c6f90ebd46c3980e788c751efda8b1a9.zip gdb-43182c09c6f90ebd46c3980e788c751efda8b1a9.tar.gz gdb-43182c09c6f90ebd46c3980e788c751efda8b1a9.tar.bz2 |
Add dwarf2_per_objfile parameter to recursively_compute_inclusions
This allows removing dwarf2_per_cu_data::dwarf2_per_objfile references
in recursively_compute_inclusions and compute_compunit_symtab_includes.
gdb/ChangeLog:
* dwarf2/read.c (recursively_compute_inclusions): Add
dwarf2_per_objfile parameter.
(compute_compunit_symtab_includes): Likewise.
(process_cu_includes): Update.
Change-Id: I1ee7f8dfc07b39763985e6764e8ce04dcc943ec5
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/dwarf2/read.c | 18 |
2 files changed, 18 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1308acd..4b78983 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2020-05-27 Simon Marchi <simon.marchi@efficios.com> + * dwarf2/read.c (recursively_compute_inclusions): Add + dwarf2_per_objfile parameter. + (compute_compunit_symtab_includes): Likewise. + (process_cu_includes): Update. + +2020-05-27 Simon Marchi <simon.marchi@efficios.com> + * dwarf2/read.c (create_partial_symtab): Add dwarf2_per_objfile parameter. (create_type_unit_group): Update. diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 3ca7772..070d880 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9629,7 +9629,8 @@ rust_union_quirks (struct dwarf2_cu *cu) static void recursively_compute_inclusions (std::vector<compunit_symtab *> *result, htab_t all_children, htab_t all_type_symtabs, - struct dwarf2_per_cu_data *per_cu, + dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile, struct compunit_symtab *immediate_parent) { void **slot = htab_find_slot (all_children, per_cu, INSERT); @@ -9642,7 +9643,7 @@ recursively_compute_inclusions (std::vector<compunit_symtab *> *result, *slot = per_cu; /* Only add a CU if it has a symbol table. */ - compunit_symtab *cust = per_cu->dwarf2_per_objfile->get_symtab (per_cu); + compunit_symtab *cust = per_objfile->get_symtab (per_cu); if (cust != NULL) { /* If this is a type unit only add its symbol table if we haven't @@ -9670,7 +9671,8 @@ recursively_compute_inclusions (std::vector<compunit_symtab *> *result, for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs) { recursively_compute_inclusions (result, all_children, - all_type_symtabs, ptr, cust); + all_type_symtabs, ptr, per_objfile, + cust); } } @@ -9678,7 +9680,8 @@ recursively_compute_inclusions (std::vector<compunit_symtab *> *result, PER_CU. */ static void -compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) +compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile) { gdb_assert (! per_cu->is_debug_types); @@ -9687,7 +9690,7 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) int len; std::vector<compunit_symtab *> result_symtabs; htab_t all_children, all_type_symtabs; - compunit_symtab *cust = per_cu->dwarf2_per_objfile->get_symtab (per_cu); + compunit_symtab *cust = per_objfile->get_symtab (per_cu); /* If we don't have a symtab, we can just skip this case. */ if (cust == NULL) @@ -9701,7 +9704,8 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu) for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs) { recursively_compute_inclusions (&result_symtabs, all_children, - all_type_symtabs, ptr, cust); + all_type_symtabs, ptr, per_objfile, + cust); } /* Now we have a transitive closure of all the included symtabs. */ @@ -9727,7 +9731,7 @@ process_cu_includes (struct dwarf2_per_objfile *dwarf2_per_objfile) for (dwarf2_per_cu_data *iter : dwarf2_per_objfile->per_bfd->just_read_cus) { if (! iter->is_debug_types) - compute_compunit_symtab_includes (iter); + compute_compunit_symtab_includes (iter, dwarf2_per_objfile); } dwarf2_per_objfile->per_bfd->just_read_cus.clear (); |