public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Pass dwarf2_cu to process_full_{comp,type}_unit
@ 2020-05-27 15:52 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2020-05-27 15:52 UTC (permalink / raw)
  To: gdb-cvs

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

commit 8fc0b21da6d25e0a9fc565a94d2301c2365f2d3c
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Wed May 27 11:14:09 2020 -0400

    Pass dwarf2_cu to process_full_{comp,type}_unit
    
    These two functions work on a dwarf2_cu.  It is currently obtained from
    the per_cu->cu link, which we want to remove.  Make them accept the
    dwarf2_cu directly as a parameter.  This moves the per_cu->cu references
    one level up, but that one will be removed too in a subsequent patch.
    
    gdb/ChangeLog:
    
            * dwarf2/read.c (process_full_comp_unit,
            process_full_type_unit): Remove per_cu, per_objfile paramters.
            Add dwarf2_cu parameter.
            (process_queue): Update.
    
    Change-Id: I1027d36986073ac991e198e06f9d51341dc19c6e

Diff:
---
 gdb/ChangeLog     |  7 +++++++
 gdb/dwarf2/read.c | 37 +++++++++++++++----------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 191fb83cb4f..4fbc44dbd18 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-27  Simon Marchi  <simon.marchi@polymtl.ca>
+
+	* dwarf2/read.c (process_full_comp_unit,
+	process_full_type_unit): Remove per_cu, per_objfile paramters.
+	Add dwarf2_cu parameter.
+	(process_queue): Update.
+
 2020-05-27  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* dwarf2/read.c (create_cu_from_index_list): Replace
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 0678c8edce8..71a10f09bad 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -1570,12 +1570,10 @@ static void load_full_comp_unit (dwarf2_per_cu_data *per_cu,
 				 bool skip_partial,
 				 enum language pretend_language);
 
-static void process_full_comp_unit (dwarf2_per_cu_data *per_cu,
-				    dwarf2_per_objfile *per_objfile,
+static void process_full_comp_unit (dwarf2_cu *cu,
 				    enum language pretend_language);
 
-static void process_full_type_unit (dwarf2_per_cu_data *per_cu,
-				    dwarf2_per_objfile *per_objfile,
+static void process_full_type_unit (dwarf2_cu *cu,
 				    enum language pretend_language);
 
 static void dwarf2_add_dependence (struct dwarf2_cu *,
@@ -9021,11 +9019,9 @@ process_queue (struct dwarf2_per_objfile *dwarf2_per_objfile)
 	    fprintf_unfiltered (gdb_stdlog, "Expanding symtab of %s\n", buf);
 
 	  if (per_cu->is_debug_types)
-	    process_full_type_unit (per_cu, dwarf2_per_objfile,
-				    item.pretend_language);
+	    process_full_type_unit (per_cu->cu, item.pretend_language);
 	  else
-	    process_full_comp_unit (per_cu, dwarf2_per_objfile,
-				    item.pretend_language);
+	    process_full_comp_unit (per_cu->cu, item.pretend_language);
 
 	  if (dwarf_read_debug >= debug_print_threshold)
 	    fprintf_unfiltered (gdb_stdlog, "Done expanding %s\n", buf);
@@ -9759,15 +9755,13 @@ process_cu_includes (struct dwarf2_per_objfile *dwarf2_per_objfile)
   dwarf2_per_objfile->per_bfd->just_read_cus.clear ();
 }
 
-/* Generate full symbol information for PER_CU, whose DIEs have
+/* Generate full symbol information for CU, whose DIEs have
    already been loaded into memory.  */
 
 static void
-process_full_comp_unit (dwarf2_per_cu_data *per_cu,
-			dwarf2_per_objfile *dwarf2_per_objfile,
-			enum language pretend_language)
+process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
 {
-  struct dwarf2_cu *cu = per_cu->cu;
+  dwarf2_per_objfile *dwarf2_per_objfile = cu->per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   struct gdbarch *gdbarch = objfile->arch ();
   CORE_ADDR lowpc, highpc;
@@ -9850,30 +9844,29 @@ process_full_comp_unit (dwarf2_per_cu_data *per_cu,
       cust->call_site_htab = cu->call_site_htab;
     }
 
-  dwarf2_per_objfile->set_symtab (per_cu, cust);
+  dwarf2_per_objfile->set_symtab (cu->per_cu, cust);
 
   /* Push it for inclusion processing later.  */
-  dwarf2_per_objfile->per_bfd->just_read_cus.push_back (per_cu);
+  dwarf2_per_objfile->per_bfd->just_read_cus.push_back (cu->per_cu);
 
   /* Not needed any more.  */
   cu->reset_builder ();
 }
 
-/* Generate full symbol information for type unit PER_CU, whose DIEs have
+/* Generate full symbol information for type unit CU, whose DIEs have
    already been loaded into memory.  */
 
 static void
-process_full_type_unit (dwarf2_per_cu_data *per_cu,
-			dwarf2_per_objfile *dwarf2_per_objfile,
+process_full_type_unit (dwarf2_cu *cu,
 			enum language pretend_language)
 {
-  struct dwarf2_cu *cu = per_cu->cu;
+  dwarf2_per_objfile *dwarf2_per_objfile = cu->per_objfile;
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   struct compunit_symtab *cust;
   struct signatured_type *sig_type;
 
-  gdb_assert (per_cu->is_debug_types);
-  sig_type = (struct signatured_type *) per_cu;
+  gdb_assert (cu->per_cu->is_debug_types);
+  sig_type = (struct signatured_type *) cu->per_cu;
 
   /* Clear the list here in case something was left over.  */
   cu->method_list.clear ();
@@ -9925,7 +9918,7 @@ process_full_type_unit (dwarf2_per_cu_data *per_cu,
       cust = tug_unshare->compunit_symtab;
     }
 
-  dwarf2_per_objfile->set_symtab (per_cu, cust);
+  dwarf2_per_objfile->set_symtab (cu->per_cu, cust);
 
   /* Not needed any more.  */
   cu->reset_builder ();


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-27 15:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 15:52 [binutils-gdb] Pass dwarf2_cu to process_full_{comp,type}_unit Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).