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