]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/buildsym: remove m_last_source_file
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 9 Jan 2026 21:56:09 +0000 (16:56 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 16 Jan 2026 17:33:30 +0000 (12:33 -0500)
Nothing seems to use this anymore.

Change-Id: I6a767f2251ce9e683c231708466899a3e9ff4cb1
Approved-By: Tom Tromey <tom@tromey.com>
gdb/buildsym.c
gdb/buildsym.h

index cc6e45294a4cd7ad7c38a31bca27742fa6283d9e..8c07884cbd57cd1a0f7cb936b3309be26ea90f7d 100644 (file)
@@ -17,9 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "buildsym.h"
-#include "bfd.h"
 #include "gdbsupport/gdb_obstack.h"
-#include "gdbsupport/pathstuff.h"
 #include "symtab.h"
 #include "symfile.h"
 #include "objfiles.h"
@@ -28,7 +26,6 @@
 #include "expression.h"
 #include "filenames.h"
 #include "macrotab.h"
-#include "demangle.h"
 #include "block.h"
 #include "cp-support.h"
 #include "dictionary.h"
@@ -50,7 +47,6 @@ buildsym_compunit::buildsym_compunit (struct objfile *objfile_,
                                      enum language language_,
                                      CORE_ADDR last_addr)
   : m_objfile (objfile_),
-    m_last_source_file (name == nullptr ? nullptr : xstrdup (name)),
     m_comp_dir (comp_dir_ == nullptr ? "" : comp_dir_),
     m_owned_compunit_symtab (std::make_unique<compunit_symtab> (m_objfile, name)),
     m_compunit_symtab (m_owned_compunit_symtab.get ()),
@@ -506,7 +502,6 @@ buildsym_compunit::patch_subfile_names (struct subfile *subfile,
       m_comp_dir = std::move (subfile->name);
       subfile->name = name;
       subfile->name_for_id = name;
-      set_last_source_file (name);
 
       /* Default the source language to whatever can be deduced from
         the filename.  If nothing can be deduced (such as for a C/C++
index eca248df79e845ca95cdb982a167307db1421f69..fe169ee14d51eb51f5b49db296f94692605f30bb 100644 (file)
@@ -152,7 +152,6 @@ struct buildsym_compunit
                     const char *comp_dir_, enum language language_,
                     CORE_ADDR last_addr, struct compunit_symtab *cust)
     : m_objfile (objfile_),
-      m_last_source_file (name == nullptr ? nullptr : make_unique_xstrdup (name)),
       m_comp_dir (comp_dir_ == nullptr ? "" : comp_dir_),
       m_compunit_symtab (cust),
       m_language (language_),
@@ -164,19 +163,6 @@ struct buildsym_compunit
 
   DISABLE_COPY_AND_ASSIGN (buildsym_compunit);
 
-  void set_last_source_file (const char *name)
-  {
-    if (name == nullptr)
-      m_last_source_file = nullptr;
-    else
-      m_last_source_file = make_unique_xstrdup (name);
-  }
-
-  const char *get_last_source_file ()
-  {
-    return m_last_source_file.get ();
-  }
-
   struct macro_table *get_macro_table ();
 
   struct macro_table *release_macros ()
@@ -343,11 +329,6 @@ private:
   /* The subfile of the main source file.  */
   struct subfile *m_main_subfile = nullptr;
 
-  /* Name of source file whose symbol data we are now processing.  This
-     comes from a symbol of type N_SO for stabs.  For DWARF it comes
-     from the DW_AT_name attribute of a DW_TAG_compile_unit DIE.  */
-  gdb::unique_xmalloc_ptr<char> m_last_source_file;
-
   /* E.g., DW_AT_comp_dir if DWARF.  Space for this is malloc'd.  */
   std::string m_comp_dir;