From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 00/10] Mildly better refcount safety for Python
Date: Fri, 20 Feb 2026 21:31:36 -0500 [thread overview]
Message-ID: <fcb66f53-7243-42f5-9336-e322cb6efe43@simark.ca> (raw)
In-Reply-To: <20260220-python-safety-minor-v1-0-4c4b12e445af@adacore.com>
On 2026-02-20 16:03, Tom Tromey wrote:
> This series converts a number of gdb-to-Python converion functions to
> return a gdbpy_ref<> rather than returning a PyObject* and then simply
> documenting that a new reference is returned.
>
> The hope is that this will make refcount mistakes less likely.
>
> Regression tested on x86-64 Fedora 43.
>
> Signed-off-by: Tom Tromey <tromey@adacore.com>
I don't know if someone else wants to review this, but I think this is
good. I think it's good if the references are managed from the point
where we get them from the Python API to the point where we release them
to the Python API.
I gave it a quick look, since it's very mechanical and I probably
wouldn't spot mistakes anyway. But I asked Claude to review and it said
it looked good. It even noted that you fixed a ref leak in the symbol
patch.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
prev parent reply other threads:[~2026-02-21 2:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 21:03 Tom Tromey
2026-02-20 21:03 ` [PATCH 01/10] Return gdbpy_ref<> from symtab_and_line_to_sal_object Tom Tromey
2026-02-21 1:58 ` Simon Marchi
2026-02-21 2:13 ` Simon Marchi
2026-02-21 22:33 ` Tom Tromey
2026-02-23 12:28 ` Tom Tromey
2026-02-20 21:03 ` [PATCH 02/10] Return gdbpy_ref<> from symbol_to_symbol_object Tom Tromey
2026-02-21 2:28 ` Simon Marchi
2026-02-21 22:35 ` Tom Tromey
2026-02-20 21:03 ` [PATCH 03/10] Return gdbpy_ref<> from symtab_to_symtab_object Tom Tromey
2026-02-20 21:03 ` [PATCH 04/10] Return gdbpy_ref<> from block_to_block_object Tom Tromey
2026-02-20 21:03 ` [PATCH 05/10] Return gdbpy_ref<> from value_to_value_object Tom Tromey
2026-02-20 21:03 ` [PATCH 06/10] Return gdbpy_ref<> from type_to_type_object Tom Tromey
2026-02-20 21:03 ` [PATCH 07/10] Return gdbpy_ref<> from frame_info_to_frame_object Tom Tromey
2026-02-20 21:03 ` [PATCH 08/10] Return gdbpy_ref<> from symtab_to_linetable_object Tom Tromey
2026-02-20 21:03 ` [PATCH 09/10] Return gdbpy_ref<> from gdbarch_to_arch_object Tom Tromey
2026-02-20 21:03 ` [PATCH 10/10] Return gdbpy_ref<> from gdbpy_registry::lookup Tom Tromey
2026-02-21 2:31 ` Simon Marchi [this message]
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=fcb66f53-7243-42f5-9336-e322cb6efe43@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.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