This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Don't steal references in the gdb Python code
- From: Tom Tromey <tom at tromey dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 17 Sep 2018 07:35:00 -0600
- Subject: Re: [PATCH] Don't steal references in the gdb Python code
- References: <20180916133441.19329-1-tom@tromey.com>
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Tom> Some Python APIs steal references from their caller, and the refcount
Tom> checker supports this via an attribute.
Tom> However, in gdb with C++ we have a better idiom available: we can use
Tom> std::move on a gdbpy_ref<> instead. This makes the semantics obvious
Tom> at the point of call, and is safer at runtime as well, because the
Tom> callee's gdbpy_ref<> will be emptied.
Tom> This patch changes the reference-stealing code in gdb to use rvalue
Tom> references instead.
I got email from Simon saying this looked good, so I pushed it in. But,
I don't see that email in the archives. It was CC'd though.
Tom