Skip to content

Commit fb3eb1d

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 42194a3 commit fb3eb1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gdb/python/py-framefilter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
11381138
htab_eq_pointer,
11391139
NULL));
11401140

1141+
int count_printed = 0;
11411142
while (true)
11421143
{
11431144
gdbpy_ref<> item (PyIter_Next (iterable.get ()));
@@ -1147,7 +1148,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
11471148
if (PyErr_Occurred ())
11481149
{
11491150
gdbpy_print_stack_or_quit ();
1150-
return EXT_LANG_BT_ERROR;
1151+
return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS;
11511152
}
11521153
break;
11531154
}
@@ -1180,6 +1181,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
11801181
error and continue with other frames. */
11811182
if (success == EXT_LANG_BT_ERROR)
11821183
gdbpy_print_stack_or_quit ();
1184+
count_printed++;
11831185
}
11841186

11851187
return success;

0 commit comments

Comments
 (0)