[RFA 5/8] Add value_freer

Pedro Alves palves@redhat.com
Fri Dec 2 14:24:00 GMT 2016


On 11/29/2016 05:05 AM, Tom Tromey wrote:
> This adds a value_freer 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.
> 
> 2016-11-28  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 value_freer.
> 	* dwarf2loc.c (dwarf2_loc_desc_get_symbol_read_needs): Use
> 	value_freer.
> 	* dwarf2-frame.c (execute_stack_op): Use value_freer.
> 	* value.h (value_freer): New class.

OK.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list