This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [python] [patch] PR 13624
- From: <Paul_Koning at Dell dot com>
- To: <pmuldoon at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Thu, 6 Oct 2011 08:22:55 -0500
- Subject: RE: [python] [patch] PR 13624
- References: <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;
+ }
+
...