Blame SOURCES/gdb-btrobust.patch

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