public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file
@ 2022-09-18  8:20 mliska at suse dot cz
  2022-09-18  8:34 ` [Bug cli/29582] " vries at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mliska at suse dot cz @ 2022-09-18  8:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

            Bug ID: 29582
           Summary: Usability improvement: CTRL+C when debugindod client
                    is downloading a file
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: mliska at suse dot cz
                CC: fchen0000 at gmail dot com, vries at gcc dot gnu.org
  Target Milestone: ---

Let's imagine you're debugging a binary with many shared libs and you're in the
middle of downloading debuginfo of the shared libs, you press CTRL+C.

At that point, the running downloading is terminated and gdb continues
downloading the next debug info. I would expect to be asked if I want to
terminate all future downloading or not. Having that one can easily exit a
debugging session instead of waiting for the cancelation of all the downloading
stuff.

Example:

[                                                                              
                                                                               
                            ]^CCancelling download of separate debug info for
/lib64/libzypp.so.1722...
Downloading 13.35 MB separate debug info for /lib64/libstdc++.so.6              
[###                                                                           
                                                                               
                            ]^CCancelling download of separate debug info for
/lib64/libstdc++.so.6...
Downloading 0.37 MB separate debug info for /lib64/libgcc_s.so.1                
[#############################################################                 
                                                                               
                            ]^CCancelling download of separate debug info for
/lib64/libgcc_s.so.1...
Downloading 5.93 MB separate debug info for /lib64/libc.so.6                    
[##                                                                            
                                                                               
                            ]^CCancelling download of separate debug info for
/lib64/libc.so.6...
[Thread debugging using libthread_db enabled]                                   
Using host libthread_db library "/lib64/libthread_db.so.1".
^CCancelling download of separate debug info for /lib64/librpm.so.9...
^CCancelling download of separate debug info for /lib64/libz.so.1...
^CCancelling download of separate debug info for
/lib64/libboost_thread.so.1.80.0...
^C^CCancelling download of separate debug info for /lib64/libglib-2.0.so.0...
^CCancelling download of separate debug info for /lib64/libcrypto.so.1.1...
^CCancelling download of separate debug info for /lib64/libsigc-2.0.so.0...
^CCancelling download of separate debug info for /lib64/libzstd.so.1...
^CCancelling download of separate debug info for /lib64/libzck.so.1...
^CCancelling download of separate debug info for /lib64/libtinfo.so.6...
^CCancelling download of separate debug info for /lib64/libfa.so.1...
^CCancelling download of separate debug info for /lib64/liblzma.so.5...
^CCancelling download of separate debug info for /lib64/libm.so.6...
^CCancelling download of separate debug info for /lib64/librpmio.so.9...
^CCancelling download of separate debug info for /lib64/libpopt.so.0...
^CCancelling download of separate debug info for /lib64/libcap.so.2...
^CCancelling download of separate debug info for /lib64/libacl.so.1...
^CCancelling download of separate debug info for /lib64/libassuan.so.0...
^CCancelling download of separate debug info for /lib64/libgpg-error.so.0...
^CCancelling download of separate debug info for /lib64/libnghttp2.so.14...
^CCancelling download of separate debug info for /lib64/libidn2.so.0...
^CCancelling download of separate debug info for /lib64/libssh.so.4...
^CCancelling download of separate debug info for /lib64/libpsl.so.5...
^CCancelling download of separate debug info for /lib64/libssl.so.1.1...
^CCancelling download of separate debug info for /lib64/libgssapi_krb5.so.2...
^CCancelling download of separate debug info for /lib64/libldap.so.2...
^CCancelling download of separate debug info for /lib64/liblber.so.2...
^CCancelling download of separate debug info for /lib64/libbrotlidec.so.1...
^CCancelling download of separate debug info for /lib64/libpcre.so.1...
^CCancelling download of separate debug info for /lib64/libgcrypt.so.20...
^CCancelling download of separate debug info for /lib64/libbz2.so.1...
^CCancelling download of separate debug info for /lib64/liblua5.4.so.5...
^CCancelling download of separate debug info for /lib64/libunistring.so.2...
^CCancelling download of separate debug info for /lib64/libkrb5.so.3...
^CCancelling download of separate debug info for /lib64/libk5crypto.so.3...
^CCancelling download of separate debug info for /lib64/libcom_err.so.2...
^CCancelling download of separate debug info for /lib64/libkrb5support.so.0...
^CCancelling download of separate debug info for /lib64/libsasl2.so.3...
^CCancelling download of separate debug info for /lib64/libbrotlicommon.so.1...
^CCancelling download of separate debug info for /lib64/libkeyutils.so.1...
^CCancelling download of separate debug info for /lib64/libresolv.so.2...
^CCancelling download of separate debug info for /lib64/libselinux.so.1...
^CCancelling download of separate debug info for /lib64/libpcre2-8.so.0...
[New Thread 0x7ffff60c76c0 (LWP 22188)]
^C
Thread 1 "Zypp-main" received signal SIGINT, Interrupt.
0x00007ffff7307c1e in fstatat64 () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install
zypper-debuginfo-1.14.56-1.1.x86_64
(gdb) Quit(gdb) Quit

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
@ 2022-09-18  8:34 ` vries at gcc dot gnu.org
  2022-09-20 11:28 ` vries at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-18  8:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
*** Bug 29581 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
  2022-09-18  8:34 ` [Bug cli/29582] " vries at gcc dot gnu.org
@ 2022-09-20 11:28 ` vries at gcc dot gnu.org
  2022-09-20 13:59 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-20 11:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
This seems to work:
...
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index 5f04a2b38ca..69dad2b9b86 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -119,6 +119,12 @@ progressfn (debuginfod_client *c, long cur, long total)
       gdb_printf ("Cancelling download of %s %ps...\n",
                  data->desc,
                  styled_string (file_name_style.style (), data->fname));
+      int resp = nquery (_("Cancel further downloading for this session? "));

+      if (resp)
+       {
+         gdb_printf (_("Debuginfod has been disabled.\n"));
+         debuginfod_enabled = debuginfod_off;
+       }
       return 1;
     }

...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
  2022-09-18  8:34 ` [Bug cli/29582] " vries at gcc dot gnu.org
  2022-09-20 11:28 ` vries at gcc dot gnu.org
@ 2022-09-20 13:59 ` vries at gcc dot gnu.org
  2022-09-20 15:36 ` mliska at suse dot cz
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-20 13:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Example session:
...
$ gcc ~/hello.c -g
$ rm -Rf ~/.cache/debuginfod_client/
$ gdb -q -iex "set debuginfod enabled on" a.out -ex start
Reading symbols from a.out...
Temporary breakpoint 1 at 0x40113a: file /home/vries/hello.c, line 6.
Starting program: /data/vries/gdb_versions/devel/a.out 
Downloading separate debug info for /lib64/ld-linux-x86-64.so.2...
^CCancelling download of separate debug info for /lib64/ld-linux-x86-64.so.2...
Cancel further downloading for this session? (y or [n]) y
Debuginfod has been disabled.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Temporary breakpoint 1, main () at /home/vries/hello.c:6
6         printf ("hello\n");
(gdb) info shared
From                To                  Syms Read   Shared Object Library
0x00007ffff7fc90a0  0x00007ffff7ff0025  Yes (*)     /lib64/ld-linux-x86-64.so.2
0x00007ffff7dd6700  0x00007ffff7f3bd8d  Yes (*)     /lib64/libc.so.6
(*): Shared library is missing debugging information.
(gdb) 
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (2 preceding siblings ...)
  2022-09-20 13:59 ` vries at gcc dot gnu.org
@ 2022-09-20 15:36 ` mliska at suse dot cz
  2022-09-22  0:16 ` amerey at redhat dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mliska at suse dot cz @ 2022-09-20 15:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #4 from Martin Liska <mliska at suse dot cz> ---
I like it Tom, thanks for it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (3 preceding siblings ...)
  2022-09-20 15:36 ` mliska at suse dot cz
@ 2022-09-22  0:16 ` amerey at redhat dot com
  2022-09-28 15:09 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: amerey at redhat dot com @ 2022-09-22  0:16 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

Aaron Merey <amerey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amerey at redhat dot com

--- Comment #5 from Aaron Merey <amerey at redhat dot com> ---
(In reply to Tom de Vries from comment #2)
> diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
> index 5f04a2b38ca..69dad2b9b86 100644
> --- a/gdb/debuginfod-support.c
> +++ b/gdb/debuginfod-support.c
> @@ -119,6 +119,12 @@ progressfn (debuginfod_client *c, long cur, long total)
>        gdb_printf ("Cancelling download of %s %ps...\n",
>                   data->desc,
>                   styled_string (file_name_style.style (), data->fname));
> +      int resp = nquery (_("Cancel further downloading for this session?
> "));
> 
> +      if (resp)
> +       {
> +         gdb_printf (_("Debuginfod has been disabled.\n"));
> +         debuginfod_enabled = debuginfod_off;
> +       }
>        return 1;
>      }

As long as debuginfod remains enabled gdb will query the user every time they
cancel a download. I think it would be preferable for gdb to remember when the
user answered "n" so that individual downloads can be cancelled without having
to answer the query each time.

Maybe we should also add a gdb command such as 'set debuginfod cancel-all
on/off' so that the behavior of ctrl-c during downloads can be set without
having to answer the query every session. 'on' could mean ctrl-c disables
debuginfod while 'off' only cancels the current download.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (4 preceding siblings ...)
  2022-09-22  0:16 ` amerey at redhat dot com
@ 2022-09-28 15:09 ` vries at gcc dot gnu.org
  2022-09-28 15:09 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-28 15:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Aaron Merey from comment #5)
> (In reply to Tom de Vries from comment #2)
> > diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
> > index 5f04a2b38ca..69dad2b9b86 100644
> > --- a/gdb/debuginfod-support.c
> > +++ b/gdb/debuginfod-support.c
> > @@ -119,6 +119,12 @@ progressfn (debuginfod_client *c, long cur, long total)
> >        gdb_printf ("Cancelling download of %s %ps...\n",
> >                   data->desc,
> >                   styled_string (file_name_style.style (), data->fname));
> > +      int resp = nquery (_("Cancel further downloading for this session?
> > "));
> > 
> > +      if (resp)
> > +       {
> > +         gdb_printf (_("Debuginfod has been disabled.\n"));
> > +         debuginfod_enabled = debuginfod_off;
> > +       }
> >        return 1;
> >      }
> 
> As long as debuginfod remains enabled gdb will query the user every time
> they cancel a download. I think it would be preferable for gdb to remember
> when the user answered "n" so that individual downloads can be cancelled
> without having to answer the query each time.
> 
> Maybe we should also add a gdb command such as 'set debuginfod cancel-all
> on/off' so that the behavior of ctrl-c during downloads can be set without
> having to answer the query every session. 'on' could mean ctrl-c disables
> debuginfod while 'off' only cancels the current download.

Good points.

I've come up with "set debuginfod cancel one/all/ask" to address these.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (5 preceding siblings ...)
  2022-09-28 15:09 ` vries at gcc dot gnu.org
@ 2022-09-28 15:09 ` vries at gcc dot gnu.org
  2022-09-29  2:23 ` amerey at redhat dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-28 15:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14367
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14367&action=edit
tentative patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (6 preceding siblings ...)
  2022-09-28 15:09 ` vries at gcc dot gnu.org
@ 2022-09-29  2:23 ` amerey at redhat dot com
  2022-09-29  8:26 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: amerey at redhat dot com @ 2022-09-29  2:23 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #8 from Aaron Merey <amerey at redhat dot com> ---
(In reply to Tom de Vries from comment #7)
> Created attachment 14367 [details]
> tentative patch

Thanks for the patch, I think this works nicely. I just have a couple
suggestions regarding some of the wording. 

> +      if (debuginfod_cancel == debuginfod_ask)
> +	{
> +	  int resp = nquery (_("Cancel further downloading for this session? "));
> +	  if (resp)
> +	    debuginfod_cancel = debuginfod_all;
> +	  else
> +	    debuginfod_cancel = debuginfod_one;
> +	}
> +      if (debuginfod_cancel == debuginfod_all)
> +	{
> +	  gdb_printf (_("Debuginfod has been disabled.\n"));

Here it could be useful to include instructions for how to re-enable
debuginfod. Something like: 
"Debuginfod has been disabled. To re-enable use the 'set debuginfod enabled on'
command."

> +  add_setshow_enum_cmd ("cancel", class_run, debuginfod_cancel_enum,
> +			_("Set cancellation mode for debuginfod."),
> +			_("Show cancellation mode for debuginfod."),
> +			_("\
> +When set to one, ^C cancels a single download.\n\
> +When set to all, ^C cancels all further downloads.\n\
> +When set to ask, ^C asks what to do."),

To be extra clear about what the cancellation mode is I'd add the following
line:

The cancellation mode controls the behavior of ^C while a file is downloading
from debuginfod.\n\
When set to one, ^C cancels a single download.\n\
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (7 preceding siblings ...)
  2022-09-29  2:23 ` amerey at redhat dot com
@ 2022-09-29  8:26 ` vries at gcc dot gnu.org
  2024-01-10 17:09 ` ssbssa at sourceware dot org
  2024-02-22 22:28 ` amerey at redhat dot com
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-29  8:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2022-September/192188.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (8 preceding siblings ...)
  2022-09-29  8:26 ` vries at gcc dot gnu.org
@ 2024-01-10 17:09 ` ssbssa at sourceware dot org
  2024-02-22 22:28 ` amerey at redhat dot com
  10 siblings, 0 replies; 12+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-10 17:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #10 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to Tom de Vries from comment #9)
> https://sourceware.org/pipermail/gdb-patches/2022-September/192188.html

I wonder why this patch was never pushed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug cli/29582] Usability improvement: CTRL+C when debugindod client is downloading a file
  2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
                   ` (9 preceding siblings ...)
  2024-01-10 17:09 ` ssbssa at sourceware dot org
@ 2024-02-22 22:28 ` amerey at redhat dot com
  10 siblings, 0 replies; 12+ messages in thread
From: amerey at redhat dot com @ 2024-02-22 22:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29582

--- Comment #11 from Aaron Merey <amerey at redhat dot com> ---
(In reply to Hannes Domani from comment #10)
> (In reply to Tom de Vries from comment #9)
> > https://sourceware.org/pipermail/gdb-patches/2022-September/192188.html
> 
> I wonder why this patch was never pushed.

I've updated this patch and reposted it to gdb-patches

https://sourceware.org/pipermail/gdb-patches/2024-February/206331.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-02-22 22:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-18  8:20 [Bug cli/29582] New: Usability improvement: CTRL+C when debugindod client is downloading a file mliska at suse dot cz
2022-09-18  8:34 ` [Bug cli/29582] " vries at gcc dot gnu.org
2022-09-20 11:28 ` vries at gcc dot gnu.org
2022-09-20 13:59 ` vries at gcc dot gnu.org
2022-09-20 15:36 ` mliska at suse dot cz
2022-09-22  0:16 ` amerey at redhat dot com
2022-09-28 15:09 ` vries at gcc dot gnu.org
2022-09-28 15:09 ` vries at gcc dot gnu.org
2022-09-29  2:23 ` amerey at redhat dot com
2022-09-29  8:26 ` vries at gcc dot gnu.org
2024-01-10 17:09 ` ssbssa at sourceware dot org
2024-02-22 22:28 ` amerey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).