Blame SOURCES/gdb-btrobust.patch

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