Blame SOURCES/gdb-btrobust.patch

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