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] Set list_in_scope later in DWARF reader


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

commit 93b8bea4143cafae79076076c64aaa4c46a9b73c
Author: Tom Tromey <tom@tromey.com>
Date:   Mon May 21 23:30:47 2018 -0600

    Set list_in_scope later in DWARF reader
    
    Currently the DWARF reader sets the list_in_scope member of the CU
    when first starting to process symbols.  Future changes will make this
    assert -- code will not be able to refer to these lists until after
    start_symtab has been called.  This patch prepares for the problem by
    arranging to initialize list_in_scope in dwarf2_start_symtab.
    
    gdb/ChangeLog
    2018-07-20  Tom Tromey  <tom@tromey.com>
    
    	* dwarf2read.c (process_full_comp_unit): Do not set list_in_scope.
    	(process_full_type_unit): Likewise.
    	(dwarf2_start_symtab): Set list_in_scope.

Diff:
---
 gdb/ChangeLog    | 6 ++++++
 gdb/dwarf2read.c | 6 ++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 96b54fb..08c7390 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2018-07-20  Tom Tromey  <tom@tromey.com>
 
+	* dwarf2read.c (process_full_comp_unit): Do not set list_in_scope.
+	(process_full_type_unit): Likewise.
+	(dwarf2_start_symtab): Set list_in_scope.
+
+2018-07-20  Tom Tromey  <tom@tromey.com>
+
 	* dwarf2read.c (process_psymtab_comp_unit_reader)
 	(build_type_psymtabs_reader): Do not set list_in_scope.
 
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index bdd1c9a..b73c06e 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -10247,8 +10247,6 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu,
   /* Clear the list here in case something was left over.  */
   cu->method_list.clear ();
 
-  cu->list_in_scope = &file_symbols;
-
   cu->language = pretend_language;
   cu->language_defn = language_def (cu->language);
 
@@ -10352,8 +10350,6 @@ process_full_type_unit (struct dwarf2_per_cu_data *per_cu,
   /* Clear the list here in case something was left over.  */
   cu->method_list.clear ();
 
-  cu->list_in_scope = &file_symbols;
-
   cu->language = pretend_language;
   cu->language_defn = language_def (cu->language);
 
@@ -21019,6 +21015,8 @@ dwarf2_start_symtab (struct dwarf2_cu *cu,
     = start_symtab (cu->per_cu->dwarf2_per_objfile->objfile, name, comp_dir,
 		    low_pc, cu->language);
 
+  cu->list_in_scope = &file_symbols;
+
   record_debugformat ("DWARF 2");
   record_producer (cu->producer);


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