aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-05-27 11:13:56 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-27 11:15:55 -0400
commitd460f6600a4452b09ee875519ebc70362863fcba (patch)
tree64787f5ea2f88b977e14cb76f936fd0954bf94b5
parentab4324907782afa676f6d8f7fe7589c99458f64b (diff)
downloadgdb-d460f6600a4452b09ee875519ebc70362863fcba.zip
gdb-d460f6600a4452b09ee875519ebc70362863fcba.tar.gz
gdb-d460f6600a4452b09ee875519ebc70362863fcba.tar.bz2
Make queue_and_load_dwo_tu receive a dwarf2_cu
queue_and_load_dwo_tu, used as a callback for htab_traverse_noresize, currently receives a dwarf2_per_cu_data as its `info` user data. It accesses the current dwarf2_cu object through the dwarf2_per_cu_data::cu field. This field will be removed, because the dwarf2_per_cu_data will become objfile-independent, while dwarf_cu will remain objfile-dependent. To remove references to this field, change queue_and_load_dwo_tu so that it expects to receive a pointer to the dwarf2_cu as its info parameter. A reference to dwarf2_per_cu_data::cu needs to be added, but it will get removed in a subsequent patch, when this function gets re-worked. I kept this as a separate patch, because since there's no strong typing here, it's easy to miss something. gdb/ChangeLog: * dwarf2/read.c (queue_and_load_dwo_tu): Expect a dwarf2_cu as the info parameter. (queue_and_load_all_dwo_tus): Pass per_cu->cu. Change-Id: I3db2a780f0e2157d52ce6939f478558ffe20abcf
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/dwarf2/read.c13
2 files changed, 12 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d6c28a5..952722f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2020-05-27 Simon Marchi <simon.marchi@polymtl.ca>
+ * dwarf2/read.c (queue_and_load_dwo_tu): Expect a dwarf2_cu as
+ the info parameter.
+ (queue_and_load_all_dwo_tus): Pass per_cu->cu.
+
+2020-05-27 Simon Marchi <simon.marchi@polymtl.ca>
+
* dwarf2/read.c (class cutu_reader) <cutu_reader>: Add
per_objfile parameter.
(load_full_type_unit): Add per_objfile parameter.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index ec32804..64cf5f4 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -12830,10 +12830,9 @@ static int
queue_and_load_dwo_tu (void **slot, void *info)
{
struct dwo_unit *dwo_unit = (struct dwo_unit *) *slot;
- struct dwarf2_per_cu_data *per_cu = (struct dwarf2_per_cu_data *) info;
+ dwarf2_cu *cu = (dwarf2_cu *) info;
ULONGEST signature = dwo_unit->signature;
- struct signatured_type *sig_type =
- lookup_dwo_signatured_type (per_cu->cu, signature);
+ signatured_type *sig_type = lookup_dwo_signatured_type (cu, signature);
if (sig_type != NULL)
{
@@ -12842,9 +12841,9 @@ queue_and_load_dwo_tu (void **slot, void *info)
/* We pass NULL for DEPENDENT_CU because we don't yet know if there's
a real dependency of PER_CU on SIG_TYPE. That is detected later
while processing PER_CU. */
- if (maybe_queue_comp_unit (NULL, sig_cu, per_cu->cu->language))
- load_full_type_unit (sig_cu, per_cu->cu->per_objfile);
- per_cu->imported_symtabs_push (sig_cu);
+ if (maybe_queue_comp_unit (NULL, sig_cu, cu->language))
+ load_full_type_unit (sig_cu, cu->per_objfile);
+ cu->per_cu->imported_symtabs_push (sig_cu);
}
return 1;
@@ -12871,7 +12870,7 @@ queue_and_load_all_dwo_tus (struct dwarf2_per_cu_data *per_cu)
dwo_file = dwo_unit->dwo_file;
if (dwo_file->tus != NULL)
htab_traverse_noresize (dwo_file->tus.get (), queue_and_load_dwo_tu,
- per_cu);
+ per_cu->cu);
}
/* Read in various DIEs. */