diff options
author | Aaron Merey <amerey@redhat.com> | 2022-06-21 17:55:29 -0400 |
---|---|---|
committer | Aaron Merey <amerey@redhat.com> | 2022-06-21 17:55:29 -0400 |
commit | 982ecf32ea84b18d144a79f3ff9097decf322a2e (patch) | |
tree | 87d3a4f59f2819e7c2c55b6f0fd9a1d64926a311 /gdb/cli-out.c | |
parent | d59d427f1f63a3200db16682ebfa8bf462a13f10 (diff) | |
download | binutils-users/amerey/debuginfod-size.zip binutils-users/amerey/debuginfod-size.tar.gz binutils-users/amerey/debuginfod-size.tar.bz2 |
Improve cur/total display, remove higher verbosity settingusers/amerey/debuginfod-size
Diffstat (limited to 'gdb/cli-out.c')
-rw-r--r-- | gdb/cli-out.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 3e5af16..7a2720d 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -295,7 +295,7 @@ cli_ui_out::do_progress_start () void cli_ui_out::do_progress_notify (const std::string &msg, const std::string &size, - double cur, double total) + double howmuch, double total) { struct ui_file *stream = m_streams.back (); cli_progress_info &info (m_progress_info.back ()); @@ -323,12 +323,11 @@ cli_ui_out::do_progress_notify (const std::string &msg, || !stream->isatty ()) return; - double howmuch = cur / total; - if (howmuch >= 0 && howmuch <= 1.0) + if (total > 0 && howmuch >= 0 && howmuch <= 1.0) { - std::string progress = string_printf (" %.02f %s / %.02f %s", - cur, size.c_str (), - total, size.c_str ()); + std::string progress = string_printf (" %3.d%% (%.02f %s)", + (int)(howmuch * 100), total, + size.c_str ()); int width = chars_per_line - progress.size () - 3; int max = width * howmuch; @@ -357,11 +356,11 @@ cli_ui_out::do_progress_notify (const std::string &msg, int width = chars_per_line - 3; gdb_printf (stream, "\r["); - for (int i = 0; i < width; ++i) { - if (i >= info.pos % width - && i < (info.pos + 3) % width) + if (i == info.pos % width + || i == (info.pos + 1) % width + || i == (info.pos + 2) % width) gdb_printf (stream, "#"); else gdb_printf (stream, " "); |