From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 3/4] Remove cli_out_new
Date: Tue, 5 Jul 2022 11:15:31 -0600 [thread overview]
Message-ID: <20220705171532.1072851-4-tromey@adacore.com> (raw)
In-Reply-To: <20220705171532.1072851-1-tromey@adacore.com>
cli_out_new is just a small wrapper around 'new'. This patch removes
it, replacing it with uses of 'new' instead.
---
gdb/cli-out.c | 8 --------
gdb/cli-out.h | 4 +---
gdb/cli/cli-interp.c | 2 +-
gdb/mi/mi-interp.c | 2 +-
gdb/tui/tui-io.c | 2 +-
5 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index e0802df352b..fdbed6f5e91 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -386,14 +386,6 @@ cli_ui_out::~cli_ui_out ()
{
}
-/* Initialize private members at startup. */
-
-cli_ui_out *
-cli_out_new (struct ui_file *stream)
-{
- return new cli_ui_out (stream, ui_source_list);
-}
-
ui_file *
cli_ui_out::set_stream (struct ui_file *stream)
{
diff --git a/gdb/cli-out.h b/gdb/cli-out.h
index 3fc794b61a4..3f01fe0db6d 100644
--- a/gdb/cli-out.h
+++ b/gdb/cli-out.h
@@ -27,7 +27,7 @@ class cli_ui_out : public ui_out
{
public:
- explicit cli_ui_out (ui_file *stream, ui_out_flags flags);
+ explicit cli_ui_out (ui_file *stream, ui_out_flags flags = ui_source_list);
virtual ~cli_ui_out ();
ui_file *set_stream (ui_file *stream);
@@ -113,8 +113,6 @@ class cli_ui_out : public ui_out
std::vector<cli_progress_info> m_meters;
};
-extern cli_ui_out *cli_out_new (struct ui_file *stream);
-
extern void cli_display_match_list (char **matches, int len, int max);
#endif
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index 036bc723b24..c26b6a75227 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -59,7 +59,7 @@ cli_interp::cli_interp (const char *name)
: cli_interp_base (name)
{
/* Create a default uiout builder for the CLI. */
- this->cli_uiout = cli_out_new (gdb_stdout);
+ this->cli_uiout = new cli_ui_out (gdb_stdout);
}
cli_interp::~cli_interp ()
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 8d6e0334a90..a14903a0718 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -141,7 +141,7 @@ mi_interp::init (bool top_level)
mi->event_channel = new mi_console_file (mi->raw_stdout, "=", 0);
mi->mi_uiout = mi_out_new (name ());
gdb_assert (mi->mi_uiout != nullptr);
- mi->cli_uiout = cli_out_new (mi->out);
+ mi->cli_uiout = new cli_ui_out (mi->out);
if (top_level)
{
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 22c234a0dc2..deea9b90afc 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -910,7 +910,7 @@ tui_initialize_io (void)
tui_out = tui_out_new (tui_stdout);
/* Create the default UI. */
- tui_old_uiout = cli_out_new (gdb_stdout);
+ tui_old_uiout = new cli_ui_out (gdb_stdout);
#ifdef TUI_USE_PIPE_FOR_READLINE
/* Temporary solution for readline writing to stdout: redirect
--
2.34.1
next prev parent reply other threads:[~2022-07-05 17:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 17:15 [PATCH 0/4] Minor 'struct ui' cleanups Tom Tromey
2022-07-05 17:15 ` [PATCH 1/4] Remove ui_register_input_event_handler Tom Tromey
2022-07-05 17:15 ` [PATCH 2/4] Replace input_interactive_p with a method Tom Tromey
2022-07-05 17:15 ` Tom Tromey [this message]
2022-07-05 17:15 ` [PATCH 4/4] Remove manual lifetime management from cli_interp Tom Tromey
2022-07-18 14:55 ` [PATCH 0/4] Minor 'struct ui' cleanups Tom Tromey
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=20220705171532.1072851-4-tromey@adacore.com \
--to=tromey@adacore.com \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).