[PATCH] gdb/debuginfod: Improve progress updates

Aaron Merey amerey@redhat.com
Wed Jan 12 22:20:16 GMT 2022


Hi Patrick,

On Tue, Jan 11, 2022 at 10:27 PM Patrick Monnerat via Gdb-patches
<gdb-patches@sourceware.org> wrote:
> On 1/12/22 03:54, Aaron Merey via Gdb-patches wrote:
> > Only print the size of the download if it is known.
> >
> >
> > -  current_uiout->progress ((double)cur / (double)total);
> > +      current_uiout->progress ((double)cur / (double)total);
> > +    }
> > +  else
> > +    {
> > +      static int spin = 0;
> > +      current_uiout->message (_("\rDownloading %s %s %c"), data->desc,
> > +                           styled_filename.c_str (), "-/|\\"[spin++ % 4]);
> > +      current_uiout->flush ();
> > +      data->printed_spin = true;
> > +    }
>
> Plase can you still call current_uiout->progress() with the negative cur
> value and move your spin process in it ?. I use ->progress() in insight
> for a graphical progress/spinning bar and this negative value is a good
> indicator that the total size is unknown.
>
> https://sourceware.org/git/?p=insight.git;a=blob;f=gdbtk/generic/gdbtk-interp.c;hb=HEAD#l71
>
> Or maybe you have another solution for the GUI?

I don't think I fully understand the purpose of calling progress() with a
negative value since the progress bar is useful only if we know the
percentage of the transfer that has completed.

When it isn't known then we don't bother printing the download size
or progress bar. Instead the throbber indicates that the transfer is ongoing.

Let me know if I have misunderstood.

Aaron



More information about the Gdb-patches mailing list