From: Tom Tromey <tom@tromey.com>
To: Matthieu Longo via Gdb <gdb@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>,
Tom Tromey <tom@tromey.com>,
Matthieu Longo <matthieu.longo@arm.com>
Subject: Re: RFC: prototype of C extensions using the Python limited API
Date: Thu, 18 Jun 2026 14:46:09 -0600 [thread overview]
Message-ID: <877bnvinla.fsf@tromey.com> (raw)
In-Reply-To: <b062c91a-eb39-4f08-9e6f-2fa781dac773@arm.com> (Matthieu Longo via Gdb's message of "Tue, 16 Jun 2026 18:15:17 +0100")
Matthieu> The prototype is organized as follows:
Matthieu> - include/
Matthieu> - py-ref.hpp: copied from GDB. Addition of a clear() method in gdbpy_ref_policy.
Do we really need this?
What if gdb_py_ref is a subclass that adds a custom method instead?
I still haven't really read the code. It's kind of difficult in this
form.
Matthieu> + gdbpy_heap_type: generic logic for dynamically-allocated types
Matthieu> (tp_traverse, tp_clear, tp_dealloc)
I don't understand why these can't just be methods of the implementation
class, by which I mean the subclasses of PyObject. If needed we could
make an intermediary base class that interposes between the
implementation and PyObject like
struct intermediary : public PyObject {};
struct type_object : public intermediary { ... }; // eg
Matthieu> I don't expect a thorough review of all the code, but a
Matthieu> validation of the approach.
I'll try to send more next week.
Tom
next prev parent reply other threads:[~2026-06-18 20:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 16:24 Matthieu Longo via Gdb
2026-05-28 16:31 ` Matthieu Longo via Gdb
2026-06-01 10:10 ` Matthieu Longo via Gdb
2026-06-08 13:38 ` Matthieu Longo via Gdb
2026-06-10 16:10 ` Andrew Burgess via Gdb
2026-06-16 17:15 ` Matthieu Longo via Gdb
2026-06-18 20:46 ` Tom Tromey [this message]
2026-06-22 9:26 ` Matthieu Longo via Gdb
2026-06-29 10:37 ` Matthieu Longo via Gdb
2026-06-22 10:24 ` Matthieu Longo via Gdb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877bnvinla.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.com \
--cc=gdb@sourceware.org \
--cc=matthieu.longo@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox