[PATCH] gdb: print size of downloaded debuginfod binary

Martin Liška
2020-12-07T11:43:22Z

With the patch, one can see now:

Reading symbols from /usr/bin/gcc...
Downloading 2.69 MiB separate debug info for /usr/bin/gcc...
Downloading 1.00 MiB separate debug info for /lib64/ld-linux-x86-64.so.2...
Downloading 10.72 MiB separate debug info for /lib64/libc.so.6...
...

ChangeLog:

* gdb/debuginfod-support.c (progressfn): Print size of the
downloaded debunginfod binary.
---
gdb/debuginfod-support.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index e21b2f40ca..ffc832e936 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -84,8 +84,8 @@ progressfn (debuginfod_client *c, long cur, long total)
{
/* Print this message only once. */
data->has_printed = true;
- printf_filtered ("Downloading %s %ps...\n",
- data->desc,
+ printf_filtered ("Downloading %.2f MiB %s %ps...\n",
+ 1.0f * total / (1024 * 1024), data->desc,
styled_string (file_name_style.style (), data->fname));
}

--
2.29.2