This is the mail archive of the 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 2017-01-15 08:42, Tom Tromey wrote:
This introduces a new typed variant of gdbpy_ref, called
gdbpy_subclass.  This is then used to simplify logic in various parts
of the Python layer; for example removing repeated error code or
removing gotos.

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).

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