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
f524ac5
FileName: 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
--
f637971
---
f637971
 gdb/python/py-framefilter.c | 4 +++-
f637971
 1 file changed, 3 insertions(+), 1 deletion(-)
Jan Kratochvil dd2c5ed
f637971
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
c42f029
index e887849c36..a8e4f49eb5 100644
f637971
--- a/gdb/python/py-framefilter.c
f637971
+++ b/gdb/python/py-framefilter.c
f637971
@@ -1388,6 +1388,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 ()));
f637971
@@ -1397,7 +1398,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
Jan Kratochvil af2c2a5
 	  if (PyErr_Occurred ())
Jan Kratochvil af2c2a5
 	    {
Jan Kratochvil af2c2a5
 	      gdbpy_print_stack ();
Jan Kratochvil af2c2a5
-	      return EXT_LANG_BT_ERROR;
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
 	}
f637971
@@ -1409,6 +1410,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
Jan Kratochvil 7cbf529
 	 error and continue with other frames.  */
Jan Kratochvil 7cbf529
       if (success == EXT_LANG_BT_ERROR)
Jan Kratochvil dd2c5ed
 	gdbpy_print_stack ();
Jan Kratochvil dd2c5ed
+      count_printed++;
Jan Kratochvil dd2c5ed
     }
Jan Kratochvil dd2c5ed
 
Jan Kratochvil dd2c5ed
   return success;
f637971
-- 
f637971
2.14.3
f637971