From: Tom Tromey <tromey@redhat.com>
To: pmuldoon@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] [python] Use TRY_CATCH in some functions.
Date: Tue, 11 Oct 2011 17:30:00 -0000 [thread overview]
Message-ID: <m3hb3fa3bc.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3zkh7bv1i.fsf@redhat.com> (Phil Muldoon's message of "Tue, 11 Oct 2011 12:57:13 +0100")
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> After fixing the bugs related to py-value.c not using TRY_CATCH in some
Phil> cases, I decided to take a look at the rest of the Python files. I
Phil> caught a few others too.
Thanks for doing this.
Phil> @@ -624,20 +625,31 @@ typy_lookup_type (struct demangle_component *demangled,
[...]
Phil> + if (except.reason < 0)
Phil> + {
Phil> + PyErr_Format (except.reason == RETURN_QUIT
Phil> + ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
Phil> + "%s", except.message);
Phil> + return NULL;
Why not GDB_PY_HANDLE_EXCEPTION here?
(And also fix up typy_lookup_typename to do the same.)
Phil> @@ -990,8 +1002,16 @@ typy_richcompare (PyObject *self, PyObject *other, int op)
[...]
Phil> + {
Phil> + bcache_xfree (cache);
Phil> + VEC_free (type_equality_entry_d, worklist);
Phil> + GDB_PY_HANDLE_EXCEPTION (except);
I think the freeing should be hoisted above the exception check, to
consolidate the code. With the current patch the code is duplicated on
both branches.
Otherwise this look good.
Tom
next prev parent reply other threads:[~2011-10-11 17:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 11:57 Phil Muldoon
2011-10-11 17:30 ` Tom Tromey [this message]
2011-10-20 13:03 ` Phil Muldoon
2011-10-20 14:23 ` Tom Tromey
2011-10-24 13:42 ` Phil Muldoon
2011-10-24 13:59 ` Tom Tromey
2011-10-27 10:17 ` 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=m3hb3fa3bc.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@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