[PATCH] gdb: print size of downloaded debuginfod binary
Tom de Vries
tdevries@suse.de
Wed Dec 9 23:26:14 GMT 2020
On 12/9/20 11:51 AM, Martin Liška wrote:
> On 12/8/20 3:28 PM, Simon Marchi wrote:
>> On 2020-12-08 5:16 a.m., Martin Liška wrote:
>> Temporary breakpoint 1 at 0x406150: file
>>> /home/marxin/Programming/gcc/gcc/gcc-main.c, line 44.
>>> Starting program: /home/marxin/bin/gcc/bin/gcc
>>> Downloading 1.00 MB separate debug info for
>>> /lib64/ld-linux-x86-64.so.2...10%..20%..30%..40%..50%..60%..70%..80%..90%..100%
>>>
>>> Downloading 4.20 MB separate debug info for
>>> /lib64/libm.so.6...10%..20%..30%..40%..50%..60%..70%..80%..90%..100%
>>> Downloading 10.72 MB separate debug info for
>>> /lib64/libc.so.6...10%..20%..30%..40%..50%
>>>
>>> Thoughts?
>>
>> Could you make it so the percentage always gets written at the same
>> place, overwriting the previous percentage written?
>
> Sure, implemented in the attached patch.
>
Hi,
I played around with this patch on openSUSE Tumbleweed and found two
problems:
- '\r' is not handled in fputs_maybe_filtered, so we run into
the pagination prompt after having printed just one downloading line
- when printing a downloading line longer than chars_per_line,
it will wrap, so the '\r' does not reset back to the actual start of
the line. The effect you see is that the download line is printed
over and over again, flooding the screen.
This updated patch fixes both problems, the latter by printing the %
progress on its own line (which is cleared by a final '\r' after
reaching 100%, in order not to waste lines on this).
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-gdb-Print-percent-progress-for-debuginfod.patch
Type: text/x-patch
Size: 2947 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20201210/11e91ab6/attachment.bin>
More information about the Gdb-patches
mailing list