Add dwarf2_per_objfile parameter to create_partial_symtab
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 27 May 2020 15:13:57 +0000 (11:13 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 27 May 2020 15:15:55 +0000 (11:15 -0400)
This allows removing a dwarf2_per_cu_data::dwarf2_per_objfile reference.

gdb/ChangeLog:

* dwarf2/read.c (create_partial_symtab): Add dwarf2_per_objfile
parameter.
(create_type_unit_group): Update.
(process_psymtab_comp_unit_reader): Update.
(build_type_psymtabs_reader): Update.

Change-Id: I72e3a8fce8022943ce6992fb623e05636cd0e3a5

gdb/ChangeLog
gdb/dwarf2/read.c

index e5f20d322729b36524da93f162ec9c498b5f54ca..1308acd068ef505ff0e0fb7cd99281802e46e6c8 100644 (file)
@@ -1,3 +1,11 @@
+2020-05-27  Simon Marchi  <simon.marchi@efficios.com>
+
+       * dwarf2/read.c (create_partial_symtab): Add dwarf2_per_objfile
+       parameter.
+       (create_type_unit_group): Update.
+       (process_psymtab_comp_unit_reader): Update.
+       (build_type_psymtabs_reader): Update.
+
 2020-05-27  Simon Marchi  <simon.marchi@efficios.com>
 
        * dwarf2/read.c (cutu_reader::keep): Access dwarf2_per_objfile
index d58303098c1f18467177a2ab32149ddbf2479380..3ca7772a46939d42b2c99bef1de5066fd9c724cd 100644 (file)
@@ -1204,7 +1204,8 @@ static void dwarf2_find_base_address (struct die_info *die,
                                      struct dwarf2_cu *cu);
 
 static dwarf2_psymtab *create_partial_symtab
-  (struct dwarf2_per_cu_data *per_cu, const char *name);
+  (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
+   const char *name);
 
 static void build_type_psymtabs_reader (const struct die_reader_specs *reader,
                                        const gdb_byte *info_ptr,
@@ -7331,7 +7332,7 @@ create_type_unit_group (struct dwarf2_cu *cu, sect_offset line_offset_struct)
       else
        name = string_printf ("<type_units_at_0x%x>", line_offset);
 
-      pst = create_partial_symtab (per_cu, name.c_str ());
+      pst = create_partial_symtab (per_cu, dwarf2_per_objfile, name.c_str ());
       pst->anonymous = true;
     }
 
@@ -7405,9 +7406,11 @@ get_type_unit_group (struct dwarf2_cu *cu, const struct attribute *stmt_list)
    dirname, textlow, texthigh.  */
 
 static dwarf2_psymtab *
-create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name)
+create_partial_symtab (dwarf2_per_cu_data *per_cu,
+                      dwarf2_per_objfile *per_objfile,
+                      const char *name)
 {
-  struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
+  struct objfile *objfile = per_objfile->objfile;
   dwarf2_psymtab *pst;
 
   pst = new dwarf2_psymtab (name, objfile, per_cu);
@@ -7429,7 +7432,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
                                  enum language pretend_language)
 {
   struct dwarf2_cu *cu = reader->cu;
-  struct objfile *objfile = cu->per_objfile->objfile;
+  dwarf2_per_objfile *per_objfile = cu->per_objfile;
+  struct objfile *objfile = per_objfile->objfile;
   struct gdbarch *gdbarch = objfile->arch ();
   struct dwarf2_per_cu_data *per_cu = cu->per_cu;
   CORE_ADDR baseaddr;
@@ -7456,7 +7460,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
       filename = debug_filename.get ();
     }
 
-  pst = create_partial_symtab (per_cu, filename);
+  pst = create_partial_symtab (per_cu, per_objfile, filename);
 
   /* This must be done before calling dwarf2_build_include_psymtabs.  */
   pst->dirname = dwarf2_string_attr (comp_unit_die, DW_AT_comp_dir, cu);
@@ -7637,7 +7641,7 @@ build_type_psymtabs_reader (const struct die_reader_specs *reader,
   tu_group->tus->push_back (sig_type);
 
   prepare_one_comp_unit (cu, type_unit_die, language_minimal);
-  pst = create_partial_symtab (per_cu, "");
+  pst = create_partial_symtab (per_cu, dwarf2_per_objfile, "");
   pst->anonymous = true;
 
   first_die = load_partial_dies (reader, info_ptr, 1);
This page took 0.035999 seconds and 4 git commands to generate.