aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli-out.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-02 11:46:15 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commit6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a (patch)
tree641a6a86240919fe4ba9219fbbbe15bc6331c22d /gdb/cli-out.c
parenta11ac3b3e8ff6769badcf0041894f6c5acc1b94f (diff)
downloadgdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.zip
gdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.gz
gdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.bz2
Unify gdb printf functions
Now that filtered and unfiltered output can be treated identically, we can unify the printf family of functions. This is done under the name "gdb_printf". Most of this patch was written by script.
Diffstat (limited to 'gdb/cli-out.c')
-rw-r--r--gdb/cli-out.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 47b256b..f396aef 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -209,7 +209,7 @@ cli_ui_out::do_spaces (int numspaces)
return;
if (test_flags (unfiltered_output))
- fprintf_unfiltered (m_streams.back (), "%*s", numspaces, "");
+ gdb_printf (m_streams.back (), "%*s", numspaces, "");
else
print_spaces_filtered (numspaces, m_streams.back ());
}
@@ -295,7 +295,7 @@ cli_ui_out::do_progress_start (const std::string &name, bool should_print)
meter.name = name;
if (!stream->isatty ())
{
- fprintf_unfiltered (stream, "%s...", meter.name.c_str ());
+ gdb_printf (stream, "%s...", meter.name.c_str ());
gdb_flush (stream);
meter.printing = WORKING;
}
@@ -322,7 +322,7 @@ cli_ui_out::do_progress_notify (double howmuch)
if (meter.printing == START)
{
- fprintf_unfiltered (stream, "%s\n", meter.name.c_str ());
+ gdb_printf (stream, "%s\n", meter.name.c_str ());
gdb_flush (stream);
meter.printing = WORKING;
}
@@ -340,10 +340,10 @@ cli_ui_out::do_progress_notify (double howmuch)
int width = chars_per_line - 3;
max = width * howmuch;
- fprintf_unfiltered (stream, "\r[");
+ gdb_printf (stream, "\r[");
for (i = 0; i < width; ++i)
- fprintf_unfiltered (stream, i < max ? "#" : " ");
- fprintf_unfiltered (stream, "]");
+ gdb_printf (stream, i < max ? "#" : " ");
+ gdb_printf (stream, "]");
gdb_flush (stream);
meter.printing = PROGRESS;
}
@@ -357,7 +357,7 @@ cli_ui_out::do_progress_end ()
if (!stream->isatty ())
{
- fprintf_unfiltered (stream, "\n");
+ gdb_printf (stream, "\n");
gdb_flush (stream);
}
else if (meter.printing == PROGRESS)
@@ -365,10 +365,10 @@ cli_ui_out::do_progress_end ()
int i;
int width = get_chars_per_line () - 3;
- fprintf_unfiltered (stream, "\r");
+ gdb_printf (stream, "\r");
for (i = 0; i < width + 2; ++i)
- fprintf_unfiltered (stream, " ");
- fprintf_unfiltered (stream, "\r");
+ gdb_printf (stream, " ");
+ gdb_printf (stream, "\r");
gdb_flush (stream);
}