Blame SOURCES/gdb-btrobust.patch

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