Blame SOURCES/gdb-btrobust.patch

475228
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
475228
From: Fedora GDB patches <invalid@email.com>
475228
Date: Fri, 27 Oct 2017 21:07:50 +0200
475228
Subject: gdb-btrobust.patch
475228
475228
;; Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
475228
;;=push
475228
475228
This should fix the error  with glib.  An error message will still be
475228
printed, but a default backtrace will occur in this case.
475228
475228
--
475228
475228
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
475228
--- a/gdb/python/py-framefilter.c
475228
+++ b/gdb/python/py-framefilter.c
475228
@@ -1139,6 +1139,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
475228
 				       htab_eq_pointer,
475228
 				       NULL));
475228
 
475228
+  int count_printed = 0;
475228
   while (true)
475228
     {
475228
       gdbpy_ref<> item (PyIter_Next (iterable.get ()));
475228
@@ -1147,8 +1148,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
475228
 	{
475228
 	  if (PyErr_Occurred ())
475228
 	    {
475228
-	      gdbpy_print_stack_or_quit ();
475228
-	      return EXT_LANG_BT_ERROR;
475228
+	      gdbpy_print_stack ();
475228
+	      return count_printed > 0 ? EXT_LANG_BT_ERROR : EXT_LANG_BT_NO_FILTERS;
475228
 	    }
475228
 	  break;
475228
 	}
475228
@@ -1181,7 +1182,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
475228
       /* Do not exit on error printing a single frame.  Print the
475228
 	 error and continue with other frames.  */
475228
       if (success == EXT_LANG_BT_ERROR)
475228
-	gdbpy_print_stack_or_quit ();
475228
+	gdbpy_print_stack ();
475228
+      count_printed++;
475228
     }
475228
 
475228
   return success;