From: Paul Koning <paulkoning@comcast.net>
To: pmuldoon@redhat.com
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: Re: [python] [patch] PR python/13331
Date: Mon, 24 Oct 2011 16:06:00 -0000 [thread overview]
Message-ID: <997BB236-D42C-42E5-B722-6045A84380CB@comcast.net> (raw)
In-Reply-To: <m3lisa5qw5.fsf@redhat.com>
On Oct 24, 2011, at 11:51 AM, Phil Muldoon wrote:
> Paul Koning <paulkoning@comcast.net> writes:
>
>>> ... On the other hand, there is
>> missing cleanup: any objects added to the tuple before the failing
>> call need to have a DECREF done on them.
>
> I'm not sure what you mean by this. If result fails, the args check in
> the calling function will fail, the exception converted to a gdb_error,
> the exception bits cleared and the call will fail. The loop will not be
> executed. It is also my understanding that PyTuple_SetItem steals a
> reference to the object being added. In this case, there is only one
> reference to the object, so the logic here works. When the tuple is
> garbage collected, the reference count for each object will
> automatically be decremented and therefore garbage collected too.
Yes, I got confused. Sorry.
> ...
>>
>> That should just be a cleanup and return NULL -- the
>> PyObject_GetAttrString has set the exception.
>
> Well yes and no, it is seemly expedient here to short-circuit the
> process and convert it to a gdb error directly. The error is more
> informative than the error from GetAttrString -- that is there is no
> "invoke" function. This is something we (as in GDB), want to enforce in
> our API
I see what you mean, that makes sense. Keep the original exception unless there is a reason to replace it -- for example to add more detail or make it more descriptive.
paul
next prev parent reply other threads:[~2011-10-24 16:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-24 13:30 Phil Muldoon
2011-10-24 13:57 ` Tom Tromey
[not found] ` <09787EF419216C41A903FD14EE5506DD030CE5E15C@AUSX7MCPC103.AMER.DELL.COM>
2011-10-24 15:39 ` Paul Koning
2011-10-24 15:47 ` Tom Tromey
2011-10-24 15:52 ` Paul Koning
2011-10-24 16:00 ` Phil Muldoon
2011-10-24 16:06 ` Paul Koning [this message]
2011-10-27 10:59 ` Phil Muldoon
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=997BB236-D42C-42E5-B722-6045A84380CB@comcast.net \
--to=paulkoning@comcast.net \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
--cc=tromey@redhat.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