aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-04-28 21:53:54 -0700
committerDoug Evans <dje@google.com>2015-04-28 21:53:54 -0700
commit69b4374a87e5029ac4831c7a4471815514df662f (patch)
tree9041be61ebe1e1bd8df326650dd946102f15ae77 /gdb/python/python.c
parent5e7cf0784c9b543b1870b974a78244c40105c523 (diff)
downloadgdb-69b4374a87e5029ac4831c7a4471815514df662f.zip
gdb-69b4374a87e5029ac4831c7a4471815514df662f.tar.gz
gdb-69b4374a87e5029ac4831c7a4471815514df662f.tar.bz2
PR python/18089
gdb/ChangeLog: PR python/18089 * python/py-prettyprint.c (print_children): Verify result of children iterator. Provide better error message. * python/python-internal..h (gdbpy_print_python_errors_p): Declare. * python/python.c (gdbpy_print_python_errors_p): New function. gdb/testsuite/ChangeLog: * gdb.python/py-bad-printers.c: New file. * gdb.python/py-bad-printers.py: New file. * gdb.python/py-bad-printers.exp: New file.
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 1da63fd..ee86680 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1182,6 +1182,14 @@ gdbpy_flush (PyObject *self, PyObject *args, PyObject *kw)
Py_RETURN_NONE;
}
+/* Return non-zero if print-stack is not "none". */
+
+int
+gdbpy_print_python_errors_p (void)
+{
+ return gdbpy_should_print_stack != python_excp_none;
+}
+
/* Print a python exception trace, print just a message, or print
nothing and clear the python exception, depending on
gdbpy_should_print_stack. Only call this if a python exception is