Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Dennis Lambe Jr." <malsyned@malsyned.net>
To: gdb-patches@sourceware.org
Subject: [RFC][PATCH 5/5] [PR gdb/33469] testsuite: framefilters-mi: async records from unwinder
Date: Mon, 22 Sep 2025 19:18:20 -0400	[thread overview]
Message-ID: <20250922231820.2667505-6-malsyned@malsyned.net> (raw)
In-Reply-To: <20250922231820.2667505-1-malsyned@malsyned.net>

Add a testsuite case to detect regressions of PR gdb/33469.
---
 gdb/testsuite/gdb.python/py-framefilter-mi.exp |  6 ++++++
 gdb/testsuite/gdb.python/py-framefilter.py     | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.exp b/gdb/testsuite/gdb.python/py-framefilter-mi.exp
index 03e5f90580c..df4b246f37a 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-mi.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter-mi.exp
@@ -71,6 +71,12 @@ mi_gdb_test "-stack-list-frames 22 24" \
     "\\^done,stack=\\\[frame={level=\"22\",addr=\"$hex\",func=\"1cnuf\".*,arch=\"$any\",children=\\\[frame={level=\"23\",addr=\"$hex\",func=\"func2\".*,arch=\"$any\"}\\\]},frame={level=\"24\",addr=\"$hex\",func=\"3cnuf\".*,arch=\"$any\"}\\\]" \
     "filtered stack list 22 24"
 
+mi_gdb_test "enable unwinder global InterruptingUnwinder" ".*1 unwinder enabled.*\\^done." "enable InterruptingUnwinder"
+mi_gdb_test "-stack-list-frames" \
+    "(=cmd-param-changed,param=\"$any\",value=\"$any\"\r?\n)+\\^done,stack=\\\[frame={level=.*" \
+    "list stack frames when unwinder emits async records"
+mi_gdb_test "disable unwinder global InterruptingUnwinder" ".*1 unwinder disabled.*\\^done." "disable InterruptingUnwinder"
+
 #stack list arguments
 
 
diff --git a/gdb/testsuite/gdb.python/py-framefilter.py b/gdb/testsuite/gdb.python/py-framefilter.py
index 5c3790d33f2..5ed95681687 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.py
+++ b/gdb/testsuite/gdb.python/py-framefilter.py
@@ -20,6 +20,7 @@ import itertools
 # frame-filters.
 import gdb
 from gdb.FrameDecorator import FrameDecorator
+from gdb.unwinder import Unwinder, register_unwinder
 
 
 class Reverse_Function(FrameDecorator):
@@ -167,6 +168,20 @@ class ErrorFilter:
             return map(ErrorInName, frame_iter)
 
 
+# An unwinder that causes some async record MI traffic
+class InterruptingUnwinder(Unwinder):
+    def __init__(self):
+        super().__init__("InterruptingUnwinder")
+        self.enabled = False
+
+    def __call__(self, pending_frame):
+        language = gdb.parameter("language")
+        gdb.set_parameter("language", "c++")
+        gdb.set_parameter("language", language)
+        return None
+
+
 FrameFilter()
 FrameElider()
 ErrorFilter()
+register_unwinder(None, InterruptingUnwinder())
-- 
2.51.0


  parent reply	other threads:[~2025-09-22 23:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 23:18 [RFC][PATCH 0/5] [PR gdb/33469] mi, python: Fix comma location when unwinder emits async records Dennis Lambe Jr.
2025-09-22 23:18 ` [RFC][PATCH 1/5] [PR gdb/33469] ui_out: add optional async param to redirect() Dennis Lambe Jr.
2025-09-22 23:18 ` [RFC][PATCH 2/5] [PR gdb/33469] ui_out_redirect_pop: add optional async param Dennis Lambe Jr.
2025-09-22 23:18 ` [RFC][PATCH 3/5] [PR gdb/33469] mi_ui_out: redirect: push separator state when async = true Dennis Lambe Jr.
2025-09-22 23:18 ` [RFC][PATCH 4/5] [PR gdb/33469] mi-interp: on_param_changed: pass async = true to redirect() Dennis Lambe Jr.
2025-09-22 23:18 ` Dennis Lambe Jr. [this message]
2025-10-03 18:39 ` [RFC][PATCH 0/5] [PR gdb/33469] mi, python: Fix comma location when unwinder emits async records Tom Tromey
2025-10-03 21:43   ` Dennis Lambe Jr.
2025-10-04 17:31     ` Tom Tromey
2026-02-19 18:27       ` Tom Tromey
2026-02-19 18:58         ` Dennis Lambe Jr.

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=20250922231820.2667505-6-malsyned@malsyned.net \
    --to=malsyned@malsyned.net \
    --cc=gdb-patches@sourceware.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