diff options
author | Tom Tromey <tom@tromey.com> | 2018-09-15 00:07:32 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-09-23 23:15:12 -0600 |
commit | 39a24317ac65837663ce1e1b0adcf880758ddc8e (patch) | |
tree | d60747875bd25c65c064c2fcfdd14370ecbcec2f /gdb/python | |
parent | f5769a2c696affc3ae1274e2329777d7d4d7e8be (diff) | |
download | gdb-39a24317ac65837663ce1e1b0adcf880758ddc8e.zip gdb-39a24317ac65837663ce1e1b0adcf880758ddc8e.tar.gz gdb-39a24317ac65837663ce1e1b0adcf880758ddc8e.tar.bz2 |
Report Python errors coming from gdb.post_event
PR python/14062 points out that errors coming from the gdb.post_event
callback are not reported. This can make it hard to understand why
your Python code in gdb isn't working.
Because users have control over whether exceptions are printed at all,
it seems good to simply have post_event report errors in the usual
way.
2018-09-23 Tom Tromey <tom@tromey.com>
PR python/14062:
* python/python.c (gdbpy_run_events): Do not ignore exceptions.
gdb/testsuite/ChangeLog
2018-09-23 Tom Tromey <tom@tromey.com>
PR python/14062:
* gdb.python/python.exp: Add test for post_event error.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/python.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index c16305b..8fbce78 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -987,10 +987,9 @@ gdbpy_run_events (int error, gdb_client_data client_data) if (gdbpy_event_list == NULL) gdbpy_event_list_end = &gdbpy_event_list; - /* Ignore errors. */ gdbpy_ref<> call_result (PyObject_CallObject (item->event, NULL)); if (call_result == NULL) - PyErr_Clear (); + gdbpy_print_stack (); Py_DECREF (item->event); xfree (item); |