Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
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: Thu, 20 Oct 2011 14:23:00 -0000	[thread overview]
Message-ID: <m3ehy7rbyy.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3fwinu8f4.fsf@redhat.com> (Phil Muldoon's message of "Thu, 20	Oct 2011 13:58:07 +0100")

>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

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;

Tom> Why not GDB_PY_HANDLE_EXCEPTION here?
Tom> (And also fix up typy_lookup_typename to do the same.)

Phil> Because typy_lookup_typename and typy_lookup_type are helper
Phil> functions that return struct type, while GDB_PY_HANDLE_EXCEPTION
Phil> returns a PyObject (from gdbpy_convert_exception).  Should we have
Phil> a macro that builds an exception without returning one? We should,
Phil> I think.  But I was not going to do that in this patch context.

Ok, I see.  Thanks.
I think both those functions should use gdbpy_convert_exception, though,
instead of replicating the exception-conversion logic themselves.

Tom


  reply	other threads:[~2011-10-20 14:10 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
2011-10-20 13:03   ` Phil Muldoon
2011-10-20 14:23     ` Tom Tromey [this message]
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=m3ehy7rbyy.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