Blame SOURCES/gdb-btrobust.patch

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