This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 5/8] Add value_freer
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 2 Dec 2016 14:23:58 +0000
- Subject: Re: [RFA 5/8] Add value_freer
- Authentication-results: sourceware.org; auth=none
- References: <1480395946-10924-1-git-send-email-tom@tromey.com> <1480395946-10924-6-git-send-email-tom@tromey.com>
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