]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: use dwz_file::filename in a few spots
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Feb 2025 21:26:07 +0000 (16:26 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 26 Feb 2025 03:34:33 +0000 (22:34 -0500)
I found a few spots where the existing dwz_file::filename method could
be used.

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

index 1fda21029f1f5e7a53ce91af90ff6072e8a19e48..af265505c019a09887e7105d6f1e8d30e1725ee3 100644 (file)
@@ -39,11 +39,11 @@ dwz_file::read_string (struct objfile *objfile, LONGEST str_offset)
   if (str.buffer == NULL)
     error (_("DW_FORM_GNU_strp_alt used without .debug_str "
             "section [in module %s]"),
-          bfd_get_filename (dwz_bfd.get ()));
+          this->filename ());
   if (str_offset >= str.size)
     error (_("DW_FORM_GNU_strp_alt pointing outside of "
             ".debug_str section [in module %s]"),
-          bfd_get_filename (dwz_bfd.get ()));
+          this->filename ());
   gdb_assert (HOST_CHAR_BIT == 8);
   if (str.buffer[str_offset] == '\0')
     return NULL;
index 6aba850628b7fbfb95c0e2a5b81fe01ae714adbb..6c01c7ad64ef8e0857413f310799b709b3af1a6a 100644 (file)
@@ -1520,14 +1520,14 @@ dwarf2_read_gdb_index
       if (dwz_index_content.empty ())
        return false;
 
-      if (!read_gdb_index_from_buffer (bfd_get_filename (dwz->dwz_bfd.get ()),
+      if (!read_gdb_index_from_buffer (dwz->filename (),
                                       1, dwz_index_content, &dwz_map,
                                       &dwz_list, &dwz_list_elements,
                                       &dwz_types_ignore,
                                       &dwz_types_elements_ignore))
        {
          warning (_("could not read '.gdb_index' section from %s; skipping"),
-                  bfd_get_filename (dwz->dwz_bfd.get ()));
+                  dwz->filename ());
          return false;
        }
     }