|
|
f9426a |
This should fix the error with glib. An error message will still be
|
|
|
f9426a |
printed, but a default backtrace will occur in this case.
|
|
|
f9426a |
|
|
|
f9426a |
--
|
|
|
f9426a |
|
|
|
f9426a |
--- gdb-7.7.90.20140613/gdb/python/py-framefilter.c-orig 2014-06-13 03:59:37.000000000 +0200
|
|
|
f9426a |
+++ gdb-7.7.90.20140613/gdb/python/py-framefilter.c 2014-06-27 17:20:00.945271945 +0200
|
|
|
f9426a |
@@ -1475,6 +1475,7 @@ gdbpy_apply_frame_filter (const struct e
|
|
|
f9426a |
volatile struct gdb_exception except;
|
|
|
f9426a |
PyObject *item;
|
|
|
f9426a |
htab_t levels_printed;
|
|
|
f9426a |
+ int count_printed = 0;
|
|
|
f9426a |
|
|
|
f9426a |
if (!gdb_python_initialized)
|
|
|
f9426a |
return EXT_LANG_BT_NO_FILTERS;
|
|
|
f9426a |
@@ -1494,24 +1495,7 @@ gdbpy_apply_frame_filter (const struct e
|
|
|
f9426a |
iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high);
|
|
|
f9426a |
|
|
|
f9426a |
if (iterable == NULL)
|
|
|
f9426a |
- {
|
|
|
f9426a |
- /* Normally if there is an error GDB prints the exception,
|
|
|
f9426a |
- abandons the backtrace and exits. The user can then call "bt
|
|
|
f9426a |
- no-filters", and get a default backtrace (it would be
|
|
|
f9426a |
- confusing to automatically start a standard backtrace halfway
|
|
|
f9426a |
- through a Python filtered backtrace). However in the case
|
|
|
f9426a |
- where GDB cannot initialize the frame filters (most likely
|
|
|
f9426a |
- due to incorrect auto-load paths), GDB has printed nothing.
|
|
|
f9426a |
- In this case it is OK to print the default backtrace after
|
|
|
f9426a |
- printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
|
|
|
f9426a |
- here to signify there are no filters after printing the
|
|
|
f9426a |
- initialization error. This return code will trigger a
|
|
|
f9426a |
- default backtrace. */
|
|
|
f9426a |
-
|
|
|
f9426a |
- gdbpy_print_stack ();
|
|
|
f9426a |
- do_cleanups (cleanups);
|
|
|
f9426a |
- return EXT_LANG_BT_NO_FILTERS;
|
|
|
f9426a |
- }
|
|
|
f9426a |
+ goto error_nothing_printed;
|
|
|
f9426a |
|
|
|
f9426a |
/* If iterable is None, then there are no frame filters registered.
|
|
|
f9426a |
If this is the case, defer to default GDB printing routines in MI
|
|
|
f9426a |
@@ -1540,15 +1524,39 @@ gdbpy_apply_frame_filter (const struct e
|
|
|
f9426a |
gdbpy_print_stack ();
|
|
|
f9426a |
|
|
|
f9426a |
Py_DECREF (item);
|
|
|
f9426a |
+ count_printed++;
|
|
|
f9426a |
}
|
|
|
f9426a |
|
|
|
f9426a |
if (item == NULL && PyErr_Occurred ())
|
|
|
f9426a |
- goto error;
|
|
|
f9426a |
+ {
|
|
|
f9426a |
+ if (count_printed > 0)
|
|
|
f9426a |
+ goto error;
|
|
|
f9426a |
+ else
|
|
|
f9426a |
+ goto error_nothing_printed;
|
|
|
f9426a |
+ }
|
|
|
f9426a |
|
|
|
f9426a |
done:
|
|
|
f9426a |
do_cleanups (cleanups);
|
|
|
f9426a |
return success;
|
|
|
f9426a |
|
|
|
f9426a |
+ /* Normally if there is an error GDB prints the exception,
|
|
|
f9426a |
+ abandons the backtrace and exits. The user can then call "bt
|
|
|
f9426a |
+ no-filters", and get a default backtrace (it would be
|
|
|
f9426a |
+ confusing to automatically start a standard backtrace halfway
|
|
|
f9426a |
+ through a Python filtered backtrace). However in the case
|
|
|
f9426a |
+ where GDB cannot initialize the frame filters (most likely
|
|
|
f9426a |
+ due to incorrect auto-load paths), GDB has printed nothing.
|
|
|
f9426a |
+ In this case it is OK to print the default backtrace after
|
|
|
f9426a |
+ printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
|
|
|
f9426a |
+ here to signify there are no filters after printing the
|
|
|
f9426a |
+ initialization error. This return code will trigger a
|
|
|
f9426a |
+ default backtrace. */
|
|
|
f9426a |
+
|
|
|
f9426a |
+ error_nothing_printed:
|
|
|
f9426a |
+ gdbpy_print_stack ();
|
|
|
f9426a |
+ do_cleanups (cleanups);
|
|
|
f9426a |
+ return EXT_LANG_BT_NO_FILTERS;
|
|
|
f9426a |
+
|
|
|
f9426a |
/* Exit and abandon backtrace on error, printing the exception that
|
|
|
f9426a |
is set. */
|
|
|
f9426a |
error:
|