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 1/5] [PR gdb/33469] ui_out: add optional async param to redirect()
Date: Mon, 22 Sep 2025 19:18:16 -0400	[thread overview]
Message-ID: <20250922231820.2667505-2-malsyned@malsyned.net> (raw)
In-Reply-To: <20250922231820.2667505-1-malsyned@malsyned.net>

This adds a new overload of the protected do_redirect(), rather than
adding an extra optional parameter, so that it can provide a default
implementation of the two-parameter form without disturbing
implementations that don't care about this distinction (which is all but
one of them).

Most uses of redirect(), such as in buffered_streams, assume that this
sort of state won't change during the redirect, so the default for the
one-parameter overload is to forward to the two-parameter form with
async = false.
---
 gdb/ui-out.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 1796e9c9eb3..f7d6be2b026 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -263,7 +263,8 @@ class ui_out
   void flush () { do_flush (); }
 
   /* Redirect the output of a ui_out object temporarily.  */
-  void redirect (ui_file *outstream) { do_redirect (outstream); }
+  void redirect (ui_file *outstream, bool async = false)
+  { do_redirect (outstream, async); }
 
   ui_out_flags test_flags (ui_out_flags mask)
   { return m_flags & mask; }
@@ -368,6 +369,8 @@ class ui_out
   virtual void do_wrap_hint (int indent) = 0;
   virtual void do_flush () = 0;
   virtual void do_redirect (struct ui_file *outstream) = 0;
+  virtual void do_redirect (struct ui_file *outstream, bool async)
+  { do_redirect (outstream); }
 
   virtual void do_progress_start () = 0;
   virtual void do_progress_notify (const std::string &, const char *,
-- 
2.51.0


  reply	other threads:[~2025-09-22 23:21 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 ` Dennis Lambe Jr. [this message]
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 ` [RFC][PATCH 5/5] [PR gdb/33469] testsuite: framefilters-mi: async records from unwinder Dennis Lambe Jr.
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-2-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