Blame SOURCES/gdb-btrobust.patch

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