|
|
7a6771 |
This should fix the error with glib. An error message will still be
|
|
|
7a6771 |
printed, but a default backtrace will occur in this case.
|
|
|
7a6771 |
|
|
|
7a6771 |
--
|
|
|
7a6771 |
|
|
|
7a6771 |
Index: gdb-7.9.50.20150520/gdb/python/py-framefilter.c
|
|
|
7a6771 |
===================================================================
|
|
|
7a6771 |
--- gdb-7.9.50.20150520.orig/gdb/python/py-framefilter.c 2015-05-31 17:36:34.681952530 +0200
|
|
|
7a6771 |
+++ gdb-7.9.50.20150520/gdb/python/py-framefilter.c 2015-05-31 17:55:01.884788031 +0200
|
|
|
7a6771 |
@@ -1523,6 +1523,7 @@ gdbpy_apply_frame_filter (const struct e
|
|
|
7a6771 |
PyObject *iterable;
|
|
|
7a6771 |
PyObject *item;
|
|
|
7a6771 |
htab_t levels_printed;
|
|
|
7a6771 |
+ int count_printed = 0;
|
|
|
7a6771 |
|
|
|
7a6771 |
if (!gdb_python_initialized)
|
|
|
7a6771 |
return EXT_LANG_BT_NO_FILTERS;
|
|
|
7a6771 |
@@ -1543,24 +1544,7 @@ gdbpy_apply_frame_filter (const struct e
|
|
|
7a6771 |
iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high);
|
|
|
7a6771 |
|
|
|
7a6771 |
if (iterable == NULL)
|
|
|
7a6771 |
- {
|
|
|
7a6771 |
- /* Normally if there is an error GDB prints the exception,
|
|
|
7a6771 |
- abandons the backtrace and exits. The user can then call "bt
|
|
|
7a6771 |
- no-filters", and get a default backtrace (it would be
|
|
|
7a6771 |
- confusing to automatically start a standard backtrace halfway
|
|
|
7a6771 |
- through a Python filtered backtrace). However in the case
|
|
|
7a6771 |
- where GDB cannot initialize the frame filters (most likely
|
|
|
7a6771 |
- due to incorrect auto-load paths), GDB has printed nothing.
|
|
|
7a6771 |
- In this case it is OK to print the default backtrace after
|
|
|
7a6771 |
- printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
|
|
|
7a6771 |
- here to signify there are no filters after printing the
|
|
|
7a6771 |
- initialization error. This return code will trigger a
|
|
|
7a6771 |
- default backtrace. */
|
|
|
7a6771 |
-
|
|
|
7a6771 |
- gdbpy_print_stack ();
|
|
|
7a6771 |
- do_cleanups (cleanups);
|
|
|
7a6771 |
- return EXT_LANG_BT_NO_FILTERS;
|
|
|
7a6771 |
- }
|
|
|
7a6771 |
+ goto error_nothing_printed;
|
|
|
7a6771 |
|
|
|
7a6771 |
/* If iterable is None, then there are no frame filters registered.
|
|
|
7a6771 |
If this is the case, defer to default GDB printing routines in MI
|
|
|
7a6771 |
@@ -1591,15 +1575,40 @@ gdbpy_apply_frame_filter (const struct e
|
|
|
7a6771 |
error and continue with other frames. */
|
|
|
7a6771 |
if (success == EXT_LANG_BT_ERROR)
|
|
|
7a6771 |
gdbpy_print_stack ();
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ count_printed++;
|
|
|
7a6771 |
}
|
|
|
7a6771 |
|
|
|
7a6771 |
if (item == NULL && PyErr_Occurred ())
|
|
|
7a6771 |
- goto error;
|
|
|
7a6771 |
+ {
|
|
|
7a6771 |
+ if (count_printed > 0)
|
|
|
7a6771 |
+ goto error;
|
|
|
7a6771 |
+ else
|
|
|
7a6771 |
+ goto error_nothing_printed;
|
|
|
7a6771 |
+ }
|
|
|
7a6771 |
|
|
|
7a6771 |
done:
|
|
|
7a6771 |
do_cleanups (cleanups);
|
|
|
7a6771 |
return success;
|
|
|
7a6771 |
|
|
|
7a6771 |
+ /* Normally if there is an error GDB prints the exception,
|
|
|
7a6771 |
+ abandons the backtrace and exits. The user can then call "bt
|
|
|
7a6771 |
+ no-filters", and get a default backtrace (it would be
|
|
|
7a6771 |
+ confusing to automatically start a standard backtrace halfway
|
|
|
7a6771 |
+ through a Python filtered backtrace). However in the case
|
|
|
7a6771 |
+ where GDB cannot initialize the frame filters (most likely
|
|
|
7a6771 |
+ due to incorrect auto-load paths), GDB has printed nothing.
|
|
|
7a6771 |
+ In this case it is OK to print the default backtrace after
|
|
|
7a6771 |
+ printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
|
|
|
7a6771 |
+ here to signify there are no filters after printing the
|
|
|
7a6771 |
+ initialization error. This return code will trigger a
|
|
|
7a6771 |
+ default backtrace. */
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ error_nothing_printed:
|
|
|
7a6771 |
+ gdbpy_print_stack ();
|
|
|
7a6771 |
+ do_cleanups (cleanups);
|
|
|
7a6771 |
+ return EXT_LANG_BT_NO_FILTERS;
|
|
|
7a6771 |
+
|
|
|
7a6771 |
/* Exit and abandon backtrace on error, printing the exception that
|
|
|
7a6771 |
is set. */
|
|
|
7a6771 |
error:
|