This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Use gdb::ref_ptr for values
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 7 Nov 2017 10:25:15 +0000
- Subject: Re: [RFA] Use gdb::ref_ptr for values
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 39C883B738
- References: <20171103173039.6397-1-tom@tromey.com>
On 11/03/2017 05:30 PM, Tom Tromey wrote:
> A while back I introduced gdb_value_up, a unique_ptr specialization
> for struct value.
>
> However, I think this is incorrect -- values are reference counted
> (albeit in a somewhat strange way), and so it's better to use a
> gdb::ref_ptr specialization.
>
> This patch makes this change. There was only one use of gdb_value_up.
>
> Regression tested on the buildbot.
>
> gdb/ChangeLog
> 2017-11-03 Tom Tromey <tom@tromey.com>
>
> * value.h (struct value_ref_policy): Rename from value_deleter.
> Change to be gdb::ref_ptr policy class.
> (gdb_value_ref): Rename from gdb_value_up. Use gdb::ref_ptr., 2017
Looks like a spurious ", 2017" managed to get here.
> * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use gdb_value_ref.
Seems fine to me.
(IWBN to s/value_free/value_decref/g throughout, I think.)
Thanks,
Pedro Alves