aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-02-28 14:27:12 -0500
committerSimon Marchi <simon.marchi@efficios.com>2025-03-03 15:58:29 -0500
commit50ca09324ae2132f9bb73324482e4c0f5eaeddd1 (patch)
tree70f0de8cc1435beb3c6ecd7257cc4846df3f4152
parentb55c841c51fd7a29aabd3af34eae0a200cfe5b93 (diff)
downloadbinutils-50ca09324ae2132f9bb73324482e4c0f5eaeddd1.zip
binutils-50ca09324ae2132f9bb73324482e4c0f5eaeddd1.tar.gz
binutils-50ca09324ae2132f9bb73324482e4c0f5eaeddd1.tar.bz2
gdb/dwarf: remove unnecessary abfd parameter in dwarf2_per_bfd::locate_sections
The parameter `abfd` is always the same as `this->obfd`, there is no need to pass it as a parameter. Change-Id: If7ad58ad4efdf6b070cbf2b8a73436bd8b452fa6 Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/dwarf2/read.c8
-rw-r--r--gdb/dwarf2/read.h3
2 files changed, 5 insertions, 6 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 1203cbd..29af3db 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1261,7 +1261,7 @@ dwarf2_per_bfd::dwarf2_per_bfd (bfd *obfd, const dwarf2_debug_sections *names,
names = &dwarf2_elf_names;
for (asection *sec = obfd->sections; sec != NULL; sec = sec->next)
- locate_sections (obfd, sec, *names);
+ this->locate_sections (sec, *names);
}
dwarf2_per_bfd::~dwarf2_per_bfd ()
@@ -1422,7 +1422,7 @@ dwarf2_has_info (struct objfile *objfile,
/* See declaration. */
void
-dwarf2_per_bfd::locate_sections (bfd *abfd, asection *sectp,
+dwarf2_per_bfd::locate_sections (asection *sectp,
const dwarf2_debug_sections &names)
{
flagword aflag = bfd_section_flags (sectp);
@@ -1430,13 +1430,13 @@ dwarf2_per_bfd::locate_sections (bfd *abfd, asection *sectp,
if ((aflag & SEC_HAS_CONTENTS) == 0)
{
}
- else if (bfd_section_size_insane (abfd, sectp))
+ else if (bfd_section_size_insane (this->obfd, sectp))
{
bfd_size_type size = sectp->size;
warning (_("Discarding section %s which has an invalid size (%s) "
"[in module %s]"),
bfd_section_name (sectp), phex_nz (size, sizeof (size)),
- bfd_get_filename (abfd));
+ this->filename ());
}
else if (names.info.matches (sectp->name))
{
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index ccc8f4f..43d0e5d 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -517,8 +517,7 @@ private:
/* This function is mapped across the sections and remembers the
offset and size of each of the debugging sections we are
interested in. */
- void locate_sections (bfd *abfd, asection *sectp,
- const dwarf2_debug_sections &names);
+ void locate_sections (asection *sectp, const dwarf2_debug_sections &names);
public:
/* The corresponding BFD. */