This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 3/5] Introduce gdbpy_subclass and use it to simplify some logic
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 9 Feb 2017 11:44:04 +0000
- Subject: Re: [RFA 3/5] Introduce gdbpy_subclass and use it to simplify some logic
- Authentication-results: sourceware.org; auth=none
- References: <20170115134253.24018-1-tom@tromey.com> <20170115134253.24018-4-tom@tromey.com> <b09a73b52d2c9365580e4462b463719b@polymtl.ca>
On 01/24/2017 08:21 PM, Simon Marchi wrote:
>> I wouldn't mind a better than than "gdb_subclass". One idea was to
>> use gdb_ref with a default template parameter, and then change the
>> existing uses of "gdb_ref" to "gdb_ref<>".
>
> Do you mean gdbpy_ref and gdbpy_subclass?
>
> I don't really like gdbpy_subclass, I think there should be "ref" in the
> name to be clear. So it could be gdbpy_subclass_ref. However, I find
> gdbpy_subclass_ref<gdbpy_breakpoint_object> a bit long. As you may have
> seen in my version of the patch, I had decided to keep gdbpy_ref for
> PyObjects and introduce typedef for other types (gdbpy_inf_ref). So I
> could see one called gdbpy_bp_ref.
>
> Otherwise, I like gdbpy_ref<> and gdbpy_ref<gdbpy_breakpoint_object>.
>
> The patch looked good to me otherwise (and confirmed that I still find
> refcounting difficult).
I agree. Simon's gdbpy_ref_base + typedef idea would work for me too.
Thanks,
Pedro Alves