This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove reset_symtab_globals


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=74c72eac237232e9c23c2b4e21d24941d804dae9

commit 74c72eac237232e9c23c2b4e21d24941d804dae9
Author: Tom Tromey <tom@tromey.com>
Date:   Tue May 22 14:23:32 2018 -0600

    Remove reset_symtab_globals
    
    This patch arranges for the remaining buildsym global --
    buildsym_compunit -- to only be cleared by the wrapper functions, not
    by methods on struct buildsym_compunit.  In the process,
    reset_symtab_globals is removed.
    
    gdb/ChangeLog
    2018-07-20  Tom Tromey  <tom@tromey.com>
    
    	* buildsym.c (reset_symtab_globals): Remove.
    	(buildsym_compunit::end_symtab_from_static_block): Update.
    	(buildsym_compunit::augment_type_symtab): Update.
    	(end_symtab_from_static_block): Call free_buildsym_compunit.
    	(augment_type_symtab, end_symtab, end_expandable_symtab):
    	Likewise.

Diff:
---
 gdb/ChangeLog  |  9 +++++++++
 gdb/buildsym.c | 20 ++++----------------
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b8fba47..62ac562 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
 2018-07-20  Tom Tromey  <tom@tromey.com>
 
+	* buildsym.c (reset_symtab_globals): Remove.
+	(buildsym_compunit::end_symtab_from_static_block): Update.
+	(buildsym_compunit::augment_type_symtab): Update.
+	(end_symtab_from_static_block): Call free_buildsym_compunit.
+	(augment_type_symtab, end_symtab, end_expandable_symtab):
+	Likewise.
+
+2018-07-20  Tom Tromey  <tom@tromey.com>
+
 	* arch-utils.c: Do not include buildsym.h.
 	* mipsread.c: Do not include buildsym.h.
 	* machoread.c: Do not include buildsym.h.
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index f98b8b6..eadc725 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1240,14 +1240,6 @@ buildsym_compunit::watch_main_source_file_lossage ()
     }
 }
 
-/* Reset state after a successful building of a symtab.  */
-
-static void
-reset_symtab_globals (void)
-{
-  free_buildsym_compunit ();
-}
-
 /* Implementation of the first part of end_symtab.  It allows modifying
    STATIC_BLOCK before it gets finalized by end_symtab_from_static_block.
    If the returned value is NULL there is no blockvector created for
@@ -1550,8 +1542,6 @@ buildsym_compunit::end_symtab_from_static_block (struct block *static_block,
   else
     cu = end_symtab_with_blockvector (static_block, section, expandable);
 
-  reset_symtab_globals ();
-
   return cu;
 }
 
@@ -1658,8 +1648,6 @@ buildsym_compunit::augment_type_symtab ()
       dict_add_pending (BLOCK_DICT (block),
 			m_global_symbols);
     }
-
-  reset_symtab_globals ();
 }
 
 /* Push a context block.  Args are an identifying nesting level
@@ -1885,7 +1873,7 @@ end_symtab_from_static_block (struct block *static_block,
   struct compunit_symtab *result
     = buildsym_compunit->end_symtab_from_static_block (static_block,
 						       section, expandable);
-  reset_symtab_globals ();
+  free_buildsym_compunit ();
   return result;
 }
 
@@ -1895,7 +1883,7 @@ end_symtab (CORE_ADDR end_addr, int section)
   gdb_assert (buildsym_compunit != nullptr);
   struct compunit_symtab *result
     = buildsym_compunit->end_symtab (end_addr, section);
-  reset_symtab_globals ();
+  free_buildsym_compunit ();
   return result;
 }
 
@@ -1905,7 +1893,7 @@ end_expandable_symtab (CORE_ADDR end_addr, int section)
   gdb_assert (buildsym_compunit != nullptr);
   struct compunit_symtab *result
     = buildsym_compunit->end_expandable_symtab (end_addr, section);
-  reset_symtab_globals ();
+  free_buildsym_compunit ();
   return result;
 }
 
@@ -1914,7 +1902,7 @@ augment_type_symtab ()
 {
   gdb_assert (buildsym_compunit != nullptr);
   buildsym_compunit->augment_type_symtab ();
-  reset_symtab_globals ();
+  free_buildsym_compunit ();
 }
 
 struct context_stack *


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]