[1/2] gdb/dwarf: remove cutu_reader::read_cutu_die_from_dwo abbrev table parameter

Message ID 20250319192115.234304-1-simon.marchi@polymtl.ca
State New
Headers
Series [1/2] gdb/dwarf: remove cutu_reader::read_cutu_die_from_dwo abbrev table parameter |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed

Commit Message

Simon Marchi March 19, 2025, 7:20 p.m. UTC
  From: Simon Marchi <simon.marchi@polymtl.ca>

This parameter is always used to set cutu_reader::m_dwo_abbrev_table.
Remove the parameter, and have read_cutu_die_from_dwo set the field
directly.

Change-Id: I6c0c7d23591fb2c3d28cdea1befa4e6b379fd0d3
---
 gdb/dwarf2/read.c | 13 +++++--------
 gdb/dwarf2/read.h |  3 +--
 2 files changed, 6 insertions(+), 10 deletions(-)


base-commit: 35ad2b260d39da9990bdff8695eee218b9aa6ead
  

Comments

Tom Tromey March 20, 2025, 7:47 p.m. UTC | #1
>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:

Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
Simon> This parameter is always used to set cutu_reader::m_dwo_abbrev_table.
Simon> Remove the parameter, and have read_cutu_die_from_dwo set the field
Simon> directly.

Looks good.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index b9040a57cf96..ea6306f4631b 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2710,8 +2710,7 @@  cutu_reader::init_cu_die_reader (dwarf2_cu *cu, dwarf2_section_info *section,
 void
 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,
-				     abbrev_table_up *result_dwo_abbrev_table)
+				     const char *stub_comp_dir)
 {
   dwarf2_per_objfile *per_objfile = cu->per_objfile;
   dwarf2_per_cu *per_cu = cu->per_cu;
@@ -2829,10 +2828,10 @@  cutu_reader::read_cutu_die_from_dwo (dwarf2_cu *cu, dwo_unit *dwo_unit,
     }
 
   dwo_abbrev_section->read (objfile);
-  *result_dwo_abbrev_table
+  m_dwo_abbrev_table
     = abbrev_table::read (dwo_abbrev_section, cu->header.abbrev_sect_off);
   this->init_cu_die_reader (cu, section, dwo_unit->dwo_file,
-			    result_dwo_abbrev_table->get ());
+			    m_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
@@ -2946,8 +2945,7 @@  cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
      could share abbrev tables.  */
 
   read_cutu_die_from_dwo (cu, sig_type->dwo_unit, NULL /* stub_comp_unit_die */,
-			  sig_type->dwo_unit->dwo_file->comp_dir,
-			  &m_dwo_abbrev_table);
+			  sig_type->dwo_unit->dwo_file->comp_dir);
   prepare_one_comp_unit (cu, pretend_language);
 }
 
@@ -3135,8 +3133,7 @@  cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
 
 	      dwo_unit = lookup_dwo_unit (cu, m_top_level_die, dwo_name);
 	      if (dwo_unit != NULL)
-		read_cutu_die_from_dwo (cu, dwo_unit, m_top_level_die, nullptr,
-					&m_dwo_abbrev_table);
+		read_cutu_die_from_dwo (cu, dwo_unit, m_top_level_die, nullptr);
 	      else
 		{
 		  /* Yikes, we couldn't find the rest of the DIE, we only have
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index ba2dd07a2ee2..c5f2bdfb87c8 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -1003,8 +1003,7 @@  class cutu_reader
 
   void read_cutu_die_from_dwo (dwarf2_cu *cu, dwo_unit *dwo_unit,
 			       die_info *stub_comp_unit_die,
-			       const char *stub_comp_dir,
-			       abbrev_table_up *result_dwo_abbrev_table);
+			       const char *stub_comp_dir);
 
   void prepare_one_comp_unit (struct dwarf2_cu *cu,
 			      enum language pretend_language);