aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-11-21 18:02:11 -0700
committerTom Tromey <tom@tromey.com>2017-01-10 19:14:12 -0700
commiteb115069323087e15210c09e3b581be0f6fb5852 (patch)
treea75b8fad89deba750322443fbd0275b3faed3cf9 /gdb/dwarf2-frame.c
parent906768f970826102252e8cfd30ee72da71de29f7 (diff)
downloadgdb-eb115069323087e15210c09e3b581be0f6fb5852.zip
gdb-eb115069323087e15210c09e3b581be0f6fb5852.tar.gz
gdb-eb115069323087e15210c09e3b581be0f6fb5852.tar.bz2
Add scoped_value_mark
This adds a scoped_value_mark class, that records the value mark in the constructor and then calls value_free_to_mark in the destructor. It then updates various spots in gdb to use this class, rather than a cleanup. It would be better overall to replace "struct value *" with a shared_ptr, maybe eliminating the need for this class (watchpoints would perhaps need some new mechanism as well). However, that's difficult to do. 2017-01-10 Tom Tromey <tom@tromey.com> * python/py-value.c (valpy_dereference, valpy_referenced_value) (valpy_reference_value, valpy_const_value, valpy_get_address) (valpy_get_dynamic_type, valpy_lazy_string, valpy_do_cast) (valpy_getitem, valpy_call, valpy_binop_throw, valpy_negative) (valpy_absolute, valpy_richcompare_throw): Use scoped_value_mark. * dwarf2loc.c (dwarf2_loc_desc_get_symbol_read_needs): Use scoped_value_mark. * dwarf2-frame.c (execute_stack_op): Use scoped_value_mark. * value.h (scoped_value_mark): New class.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index c6a3d40..c5ad0dd 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -403,10 +403,9 @@ execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size,
CORE_ADDR initial, int initial_in_stack_memory)
{
CORE_ADDR result;
- struct cleanup *old_chain;
dwarf_expr_executor ctx;
- old_chain = make_cleanup_value_free_to_mark (value_mark ());
+ scoped_value_mark free_values;
ctx.this_frame = this_frame;
ctx.gdbarch = get_frame_arch (this_frame);
@@ -430,8 +429,6 @@ execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size,
Not implemented: computing unwound register using explicit value operator"));
}
- do_cleanups (old_chain);
-
return result;
}