public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdb] gdb-17.2-rebase-f44: Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
Date: Sat, 27 Jun 2026 23:56:40 GMT	[thread overview]
Message-ID: <178260460062.1.9825525920024417510.rpms-gdb-dd2c5ed0e6ad@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : dd2c5ed0e6adf477b7719e67807b08d88bc7f714
Author : Jan Kratochvil <jan.kratochvil@redhat.com>
Date   : 2014-06-27T17:47:58+02:00
Stats  : +90/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gdb/c/dd2c5ed0e6adf477b7719e67807b08d88bc7f714?branch=gdb-17.2-rebase-f44

Log:
Continue backtrace even if a frame filter throws an exception (Phil Muldoon).

---
diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch
new file mode 100644
index 0000000..0da4515
--- /dev/null
+++ b/gdb-btrobust.patch
@@ -0,0 +1,82 @@
+This should fix the error  with glib.  An error message will still be
+printed, but a default backtrace will occur in this case.
+
+--
+
+--- gdb-7.7.90.20140613/gdb/python/py-framefilter.c-orig	2014-06-13 03:59:37.000000000 +0200
++++ gdb-7.7.90.20140613/gdb/python/py-framefilter.c	2014-06-27 17:20:00.945271945 +0200
+@@ -1475,6 +1475,7 @@ gdbpy_apply_frame_filter (const struct e
+   volatile struct gdb_exception except;
+   PyObject *item;
+   htab_t levels_printed;
++  int count_printed = 0;
+ 
+   if (!gdb_python_initialized)
+     return EXT_LANG_BT_NO_FILTERS;
+@@ -1494,24 +1495,7 @@ gdbpy_apply_frame_filter (const struct e
+   iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high);
+ 
+   if (iterable == NULL)
+-    {
+-      /* Normally if there is an error GDB prints the exception,
+-	 abandons the backtrace and exits.  The user can then call "bt
+-	 no-filters", and get a default backtrace (it would be
+-	 confusing to automatically start a standard backtrace halfway
+-	 through a Python filtered backtrace).  However in the case
+-	 where GDB cannot initialize the frame filters (most likely
+-	 due to incorrect auto-load paths), GDB has printed nothing.
+-	 In this case it is OK to print the default backtrace after
+-	 printing the error message.  GDB returns EXT_LANG_BT_NO_FILTERS
+-	 here to signify there are no filters after printing the
+-	 initialization error.  This return code will trigger a
+-	 default backtrace.  */
+-
+-      gdbpy_print_stack ();
+-      do_cleanups (cleanups);
+-      return EXT_LANG_BT_NO_FILTERS;
+-    }
++    goto error_nothing_printed;
+ 
+   /* If iterable is None, then there are no frame filters registered.
+      If this is the case, defer to default GDB printing routines in MI
+@@ -1540,15 +1524,39 @@ gdbpy_apply_frame_filter (const struct e
+ 	gdbpy_print_stack ();
+ 
+       Py_DECREF (item);
++      count_printed++;
+     }
+ 
+   if (item == NULL && PyErr_Occurred ())
+-    goto error;
++    {
++      if (count_printed > 0)
++	goto error;
++      else
++	goto error_nothing_printed;
++    }
+ 
+  done:
+   do_cleanups (cleanups);
+   return success;
+ 
++  /* Normally if there is an error GDB prints the exception,
++     abandons the backtrace and exits.  The user can then call "bt
++     no-filters", and get a default backtrace (it would be
++     confusing to automatically start a standard backtrace halfway
++     through a Python filtered backtrace).  However in the case
++     where GDB cannot initialize the frame filters (most likely
++     due to incorrect auto-load paths), GDB has printed nothing.
++     In this case it is OK to print the default backtrace after
++     printing the error message.  GDB returns EXT_LANG_BT_NO_FILTERS
++     here to signify there are no filters after printing the
++     initialization error.  This return code will trigger a
++     default backtrace.  */
++
++ error_nothing_printed:
++  gdbpy_print_stack ();
++  do_cleanups (cleanups);
++  return EXT_LANG_BT_NO_FILTERS;
++
+   /* Exit and abandon backtrace on error, printing the exception that
+      is set.  */
+  error:

diff --git a/gdb.spec b/gdb.spec
index 8ddddb7..5920c21 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -25,7 +25,7 @@ Version: 7.7.90.20140613
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 4%{?dist}
+Release: 5%{?dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
 Group: Development/Debuggers
@@ -540,6 +540,9 @@ Patch913: gdb-watchpoint-fork-fix.patch
 # Fix --with-system-readline with readline-6.3 patch 5.
 Patch914: gdb-readline-6.3.5.patch
 
+# Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
+Patch918: gdb-btrobust.patch
+
 %if 0%{!?rhel:1} || 0%{?rhel} > 6
 # RL_STATE_FEDORA_GDB would not be found for:
 # Patch642: gdb-readline62-ask-more-rh.patch
@@ -839,6 +842,7 @@ find -name "*.info*"|xargs rm -f
 %patch911 -p1
 %patch913 -p1
 %patch914 -p1
+%patch918 -p1
 
 %patch848 -p1
 %if 0%{!?el6:1}
@@ -1324,6 +1328,9 @@ then
 fi
 
 %changelog
+* Fri Jun 27 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.90.20140613-5.fc21
+- Continue backtrace even if a frame filter throws an exception (Phil Muldoon).
+
 * Tue Jun 24 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.7.90.20140613-4.fc21
 - [aarch64] Fix compilation error.
 

                 reply	other threads:[~2026-06-27 23:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178260460062.1.9825525920024417510.rpms-gdb-dd2c5ed0e6ad@fedoraproject.org \
    --to=jan.kratochvil@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox