Use scoped_value_mark in dwarf2_evaluate_loc_desc_full
authorTom Tromey <tom@tromey.com>
Tue, 22 Nov 2016 04:04:59 +0000 (21:04 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 11 Jan 2017 02:14:13 +0000 (19:14 -0700)
commit0cf082277804ba3747be70a4013019f68b92bb84
tree4277ab15a1d85e67962e4c39229a94c705886c14
parenteb115069323087e15210c09e3b581be0f6fb5852
Use scoped_value_mark in dwarf2_evaluate_loc_desc_full

This changes dwarf2_evaluate_loc_desc_full to use scoped_value_mark.

Note that this function previously called do_cleanup using the same
cleanup multiple times.  I had thought this was buggy, but re-reading
make_my_cleanup2 indicates that it is not.  Nevertheless it is
surprising, and at least one of the calls (the one that is completely
removed in this patch) seems to have been done under the assumption
that it would still have some effect.

2017-01-10  Tom Tromey  <tom@tromey.com>

* value.h (scoped_value_mark::~scoped_value_mark): Call
free_to_mark.
(scoped_value_mark::free_to_mark): New method.
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use
scoped_value_mark.
gdb/ChangeLog
gdb/dwarf2loc.c
gdb/value.h