aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-03-05 16:10:04 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2025-03-06 11:39:00 -0500
commitd1a5224cd3be966d4aecb195405556e66b534206 (patch)
tree3d616825339d06432f8eec8ccc3877a9baab449c
parent61cc67a504e9b2a9ade6d33b0e74c346c41f94bd (diff)
downloadbinutils-d1a5224cd3be966d4aecb195405556e66b534206.zip
binutils-d1a5224cd3be966d4aecb195405556e66b534206.tar.gz
binutils-d1a5224cd3be966d4aecb195405556e66b534206.tar.bz2
gdb/dwarf: make read_cutu_die_from_dwo a method of cutu_reader
read_cutu_die_from_dwo is only used as a helper to cutu_reader, so make it a private method of cutu_reader. Remove the "result_reader" parameter, because it's always "this". Change-Id: I7df6162137451c160f0e6bf3539569fcb2421eff Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/dwarf2/read.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 3aa3e9e..987dda5 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -691,6 +691,13 @@ private:
dwarf2_cu *existing_cu,
enum language pretend_language);
+ int read_cutu_die_from_dwo (dwarf2_cu *cu, dwo_unit *dwo_unit,
+ die_info *stub_comp_unit_die,
+ const char *stub_comp_dir,
+ const gdb_byte **result_info_ptr,
+ die_info **result_comp_unit_die,
+ abbrev_table_up *result_dwo_abbrev_table);
+
void prepare_one_comp_unit (struct dwarf2_cu *cu,
enum language pretend_language);
@@ -2934,13 +2941,13 @@ init_cu_die_reader (cutu_reader *reader, dwarf2_cu *cu,
The result is non-zero if a valid (non-dummy) DIE was found. */
-static int
-read_cutu_die_from_dwo (dwarf2_cu *cu, dwo_unit *dwo_unit,
- die_info *stub_comp_unit_die, const char *stub_comp_dir,
- cutu_reader *result_reader,
- const gdb_byte **result_info_ptr,
- die_info **result_comp_unit_die,
- abbrev_table_up *result_dwo_abbrev_table)
+int
+cutu_reader::read_cutu_die_from_dwo (dwarf2_cu *cu, dwo_unit *dwo_unit,
+ die_info *stub_comp_unit_die,
+ const char *stub_comp_dir,
+ const gdb_byte **result_info_ptr,
+ die_info **result_comp_unit_die,
+ abbrev_table_up *result_dwo_abbrev_table)
{
dwarf2_per_objfile *per_objfile = cu->per_objfile;
dwarf2_per_cu *per_cu = cu->per_cu;
@@ -3060,16 +3067,16 @@ read_cutu_die_from_dwo (dwarf2_cu *cu, dwo_unit *dwo_unit,
dwo_abbrev_section->read (objfile);
*result_dwo_abbrev_table
= abbrev_table::read (dwo_abbrev_section, cu->header.abbrev_sect_off);
- init_cu_die_reader (result_reader, cu, section, dwo_unit->dwo_file,
+ init_cu_die_reader (this, cu, section, dwo_unit->dwo_file,
result_dwo_abbrev_table->get ());
/* Read in the die, filling in the attributes from the stub. This
has the benefit of simplifying the rest of the code - all the
work to maintain the illusion of a single
DW_TAG_{compile,type}_unit DIE is done here. */
- info_ptr = read_toplevel_die (result_reader, result_comp_unit_die, info_ptr,
- gdb::make_array_view (attributes,
- next_attr_idx));
+ info_ptr
+ = read_toplevel_die (this, result_comp_unit_die, info_ptr,
+ gdb::make_array_view (attributes, next_attr_idx));
/* Skip dummy compilation units. */
if (info_ptr >= begin_info_ptr + dwo_unit->length
@@ -3179,10 +3186,9 @@ cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
if (read_cutu_die_from_dwo (cu, sig_type->dwo_unit,
NULL /* stub_comp_unit_die */,
- sig_type->dwo_unit->dwo_file->comp_dir,
- this, &info_ptr,
- &comp_unit_die,
- &m_dwo_abbrev_table) == 0)
+ sig_type->dwo_unit->dwo_file->comp_dir, &info_ptr,
+ &comp_unit_die, &m_dwo_abbrev_table)
+ == 0)
{
/* Dummy die. */
dummy_p = true;
@@ -3378,11 +3384,10 @@ cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
dwo_unit = lookup_dwo_unit (cu, comp_unit_die, dwo_name);
if (dwo_unit != NULL)
{
- if (read_cutu_die_from_dwo (cu, dwo_unit,
- comp_unit_die, NULL,
- this, &info_ptr,
- &dwo_comp_unit_die,
- &m_dwo_abbrev_table) == 0)
+ if (read_cutu_die_from_dwo (cu, dwo_unit, comp_unit_die, NULL,
+ &info_ptr, &dwo_comp_unit_die,
+ &m_dwo_abbrev_table)
+ == 0)
{
/* Dummy die. */
dummy_p = true;