public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Pedro Alves <pedro@palves.net>
Cc: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/debuginfod] Ask to cancel further downloads
Date: Tue, 4 Oct 2022 21:44:08 -0400	[thread overview]
Message-ID: <CAJDtP-QJQOKVG==EF7fwNpWdHXv8-PPUckRvz9rEkHmUqxtA+w@mail.gmail.com> (raw)
In-Reply-To: <697074fa-9813-70b9-6bd7-f1796428f1e7@palves.net>

On Fri, Sep 30, 2022 at 12:15 PM Pedro Alves <pedro@palves.net> wrote:
> Cool.  I think the thing missing (not in this patch, but in gdb) is handling
> ^C pressed while the inferior is running and GDB decides to download from debuginfod.
>
> I mean, something like:
>
> (gdb) c
> ...
> # inferior is running, dlopens a library, and gdb downloads debug info from debuginfod
>
> # just while gdb starts downloading one of the libraries, the user presses ^C, intending
> # to pause the inferior.
>
> I think gdb always switches to terminal-ours before downloading with debuginfod, and
> assumes the ^C indicates the user wanted to cancel the download?

That's correct.

> I think in this scenario, we should do something similar to target remote's "pressed twice"
> handling.
>
> - user presses once ctrl-c while download is happening _and_ inferior has terminal
>     => Do nothing, set quit flag again, so ctrl-c isn't lost.  Set a global flag indicating
>        ctrl-c was already pressed once.  The idea is that maybe the download finishes quickly,
>        and then gdb soon elsewhere notices the quit_flag and stops the inferior.
>        Everything Just Works.
>
> - user is impacient and presses ctrl-c a second time while download is happening _and_
>   inferior has terminal
>     => gdb asks user what to do:
>
>        - interrupt program?
>        - cancel download?

This should help eliminate some ambiguity around ctrl-c.  If there are two
ctrl-c during a download we can first ask whether to interrupt the program
or cancel the download.  If the user wishes to cancel a download then we
can ask whether to cancel all downloads or just the current one, like
what's been implemented in this patch.

This patch should still be worth merging alone though, with the ctrl-c
tweak added in a separate patch.

Aaron


      reply	other threads:[~2022-10-05  1:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29  8:25 Tom de Vries
2022-09-29 19:29 ` Aaron Merey
2022-09-30 16:15   ` Pedro Alves
2022-10-05  1:44     ` Aaron Merey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJDtP-QJQOKVG==EF7fwNpWdHXv8-PPUckRvz9rEkHmUqxtA+w@mail.gmail.com' \
    --to=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).