Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: <Paul_Koning@Dell.com>
To: <pmuldoon@redhat.com>, <gdb-patches@sourceware.org>
Subject: RE: [python] [patch] PR 13624
Date: Thu, 06 Oct 2011 13:23:00 -0000	[thread overview]
Message-ID: <09787EF419216C41A903FD14EE5506DD030A67EFC1@AUSX7MCPC103.AMER.DELL.COM> (raw)
In-Reply-To: <m3lisy8eui.fsf@redhat.com>

Could you make the new exception be a more explicit Pythonic one?  TypeError seems like the natural fit.

	paul

-----Original Message-----
From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Phil Muldoon
Sent: Thursday, October 06, 2011 8:49 AM
To: gdb-patches@sourceware.org
Subject: [python] [patch] PR 13624


The patch address PR 13624 which noted that in some instances we were not catching GDB exceptions.  I checked every function and I found two GDB cases, and one Python case.

OK?

Cheers,

Phil

--

2011-10-06  Phil Muldoon  <pmuldoon@redhat.com>

	* python/py-value.c (valpy_call): Check that arguments are
	a tuple.
	(valpy_nonzero): Catch GDB exceptions.
	(valpy_absolute): Ditto.
--

diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 252d9b9..48bbb0a 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -519,6 +519,13 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
       return NULL;
     }
 
+  if (! PyTuple_Check (args))
+    {
+      PyErr_SetString (PyExc_RuntimeError,
+		       _("Inferior arguments must be provided in a tuple."));
+      return NULL;
+    }
+
...


  reply	other threads:[~2011-10-06 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 12:49 Phil Muldoon
2011-10-06 13:23 ` Paul_Koning [this message]
2011-10-06 13:51 ` Tom Tromey
2011-10-06 15:43   ` Phil Muldoon
2011-10-06 17:44     ` Tom Tromey
2011-10-07 13:47       ` 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=09787EF419216C41A903FD14EE5506DD030A67EFC1@AUSX7MCPC103.AMER.DELL.COM \
    --to=paul_koning@dell.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