aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-02-26 01:41:01 -0500
committerSimon Marchi <simon.marchi@efficios.com>2020-05-12 15:24:50 -0400
commitcaca6f5b4e37a3f2172e5eabe6afe6487bdee905 (patch)
tree63d1317cb872fc7421a72379a90a57c98fb90ea3
parent7b9424e48890312129cd00183b169f7be28ad30a (diff)
downloadgdb-caca6f5b4e37a3f2172e5eabe6afe6487bdee905.zip
gdb-caca6f5b4e37a3f2172e5eabe6afe6487bdee905.tar.gz
gdb-caca6f5b4e37a3f2172e5eabe6afe6487bdee905.tar.bz2
Add dwarf2_per_objfile parameter to allocate_piece_closure
This allows removing a dwarf2_per_cu_data::dwarf2_per_objfile reference. gdb/ChangeLog: * dwarf2/loc.c (allocate_piece_closure): Add dwarf2_per_objfile parameter. (dwarf2_evaluate_loc_desc_full): Update.
-rw-r--r--gdb/dwarf2/loc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 4c21a51..4b32040 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1576,7 +1576,8 @@ struct piece_closure
PIECES. */
static struct piece_closure *
-allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
+allocate_piece_closure (dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
std::vector<dwarf_expr_piece> &&pieces,
struct frame_info *frame)
{
@@ -1584,7 +1585,7 @@ allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
c->refc = 1;
/* We must capture this here due to sharing of DWARF state. */
- c->per_objfile = per_cu->dwarf2_per_objfile;
+ c->per_objfile = per_objfile;
c->per_cu = per_cu;
c->pieces = std::move (pieces);
if (frame == NULL)
@@ -2245,7 +2246,8 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
if (bit_size > 8 * TYPE_LENGTH (type))
invalid_synthetic_pointer ();
- c = allocate_piece_closure (per_cu, std::move (ctx.pieces), frame);
+ c = allocate_piece_closure (per_cu, per_objfile, std::move (ctx.pieces),
+ frame);
/* We must clean up the value chain after creating the piece
closure but before allocating the result. */
free_values.free_to_mark ();