Blame SOURCES/gdb-btrobust.patch

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