This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 3/5] Introduce gdbpy_subclass and use it to simplify some logic


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]