Skip to content

Commit 5dbe136

Browse files
ivanivanov884jeffmahoney
authored andcommitted
gdb-btrobust.patch
;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon). ;;=push This should fix the error with glib. An error message will still be printed, but a default backtrace will occur in this case. --
1 parent 1069abe commit 5dbe136

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gdb/python/py-framefilter.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
11511151
htab_eq_pointer,
11521152
NULL));
11531153

1154+
int count_printed = 0;
11541155
while (true)
11551156
{
11561157
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
@@ -1159,8 +1160,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
11591160
{
11601161
if (PyErr_Occurred ())
11611162
{
1162-
throw_quit_or_print_exception ();
1163-
return EXT_LANG_BT_ERROR;
1163+
gdbpy_print_stack ();
1164+
return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS;
11641165
}
11651166
break;
11661167
}
@@ -1193,7 +1194,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
11931194
/* Do not exit on error printing a single frame. Print the
11941195
error and continue with other frames. */
11951196
if (success == EXT_LANG_BT_ERROR)
1196-
throw_quit_or_print_exception ();
1197+
gdbpy_print_stack ();
1198+
count_printed++;
11971199
}
11981200

11991201
return success;

0 commit comments

Comments
 (0)