]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: cleanup dwarf2_locate_v{2,5}_dwp_sections parameters
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 15 Jan 2026 03:55:27 +0000 (22:55 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 15 Jan 2026 16:17:40 +0000 (11:17 -0500)
Change the `void *` parameter to `dwp_file *`.  Remove the unused `abfd`
parameter.  These were probably missed when converting the caller from
bfd_map_over_sections to gdb_bfd_sections.

Change-Id: I0420c83ba35ae304901b9e140584ebaba31f2330
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c

index b8c55e640dc7ec04e55738290df8acc64b866034..e3c8f1e333f7dd8fdd32dd610eee6e051265f5b8 100644 (file)
@@ -7472,10 +7472,9 @@ dwarf2_locate_common_dwp_sections (struct objfile *objfile, bfd *abfd,
    have version 2 or 5 until we parse the cu_index/tu_index sections.  */
 
 static void
-dwarf2_locate_v2_dwp_sections (struct objfile *objfile, bfd *abfd,
-                              asection *sectp, void *dwp_file_ptr)
+dwarf2_locate_v2_dwp_sections (objfile *objfile, asection *sectp,
+                              dwp_file *dwp_file)
 {
-  struct dwp_file *dwp_file = (struct dwp_file *) dwp_file_ptr;
   const struct dwop_section_names *names = &dwop_section_names;
 
   /* Look for specific sections that we need.  */
@@ -7515,10 +7514,9 @@ dwarf2_locate_v2_dwp_sections (struct objfile *objfile, bfd *abfd,
    have version 2 or 5 until we parse the cu_index/tu_index sections.  */
 
 static void
-dwarf2_locate_v5_dwp_sections (struct objfile *objfile, bfd *abfd,
-                              asection *sectp, void *dwp_file_ptr)
+dwarf2_locate_v5_dwp_sections (objfile *objfile, asection *sectp,
+                              dwp_file *dwp_file)
 {
-  struct dwp_file *dwp_file = (struct dwp_file *) dwp_file_ptr;
   const struct dwop_section_names *names = &dwop_section_names;
 
   /* Look for specific sections that we need.  */
@@ -7665,11 +7663,9 @@ open_and_init_dwp_file (dwarf2_per_objfile *per_objfile)
   for (asection *sec : gdb_bfd_sections (dwp_file->dbfd))
     {
       if (dwp_file->version == 2)
-       dwarf2_locate_v2_dwp_sections (objfile, dwp_file->dbfd.get (), sec,
-                                      dwp_file.get ());
+       dwarf2_locate_v2_dwp_sections (objfile, sec, dwp_file.get ());
       else
-       dwarf2_locate_v5_dwp_sections (objfile, dwp_file->dbfd.get (), sec,
-                                      dwp_file.get ());
+       dwarf2_locate_v5_dwp_sections (objfile, sec, dwp_file.get ());
     }
 
   dwarf_read_debug_printf ("DWP file found: %s", dwp_file->name);