From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7B7A83858D37 for ; Wed, 5 Oct 2022 01:44:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B7A83858D37 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-260-7dOWAl8sPE6s6_7Jf4WmAw-1; Tue, 04 Oct 2022 21:44:21 -0400 X-MC-Unique: 7dOWAl8sPE6s6_7Jf4WmAw-1 Received: by mail-wm1-f71.google.com with SMTP id p24-20020a05600c1d9800b003b4b226903dso268395wms.4 for ; Tue, 04 Oct 2022 18:44:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Tdd6d3KnIjdQd22yEycq4lPi3vYQtWi10kND2d6vVag=; b=iIanVjfMRJyypz8yqwnS8Ur+0OStVNCWet81bwOXzTHboeT1XAVHXDLjrKxcw0GzNA 0ViSKW3hNmSIHgMei6W2wsNbbgBUK2+tWshJ14dHKBbw2q+pfFOtUoIa59lSXDUm2GiO XQa48xNwbFrIZJm/Dq0EZWaDdiV2jRAhEXvf0WSCHKWXakhiIr+mqA+pIGOBASGQecjw 4zPHIEoYruUlaP/hWisqghI7KMxqfInRli9JLFQxfDwZ6i5bGEFLsVgVfTd4cmYq1opd O6MF8hskSddk/LnWwjIJEmY5R/O4vQJxL4H6/ivkUwiNxZZQmRv7VniWMomjq+mbwQ++ rX6g== X-Gm-Message-State: ACrzQf1rX8Q4hO259q8Wx+NNd3ODpFb0iP/bQaE1fOCgr91W9sMojENP C5fiEseJOsuTlgZ+JxPLDstzibmOaSnwhVEC9u5gkzT9YZBO40B1aIzKY3iN2CYJyFpuS/lcIYb r8AxB+nmCePIqq5AM/iz3YCDVvhIOxoO9G/RA X-Received: by 2002:a05:600c:1c1f:b0:3b4:8330:5a46 with SMTP id j31-20020a05600c1c1f00b003b483305a46mr1641966wms.45.1664934260118; Tue, 04 Oct 2022 18:44:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hCDOrL9Mn75HALumxNYNhsR9uo101vg0GMYCrRVYr6MBfpSHOI6nNSyXuxxIdbtc7XG7AGevBDnVgqc467lk= X-Received: by 2002:a05:600c:1c1f:b0:3b4:8330:5a46 with SMTP id j31-20020a05600c1c1f00b003b483305a46mr1641961wms.45.1664934259935; Tue, 04 Oct 2022 18:44:19 -0700 (PDT) MIME-Version: 1.0 References: <20220929082534.GA22465@delia.home> <697074fa-9813-70b9-6bd7-f1796428f1e7@palves.net> In-Reply-To: <697074fa-9813-70b9-6bd7-f1796428f1e7@palves.net> From: Aaron Merey Date: Tue, 4 Oct 2022 21:44:08 -0400 Message-ID: Subject: Re: [PATCH][gdb/debuginfod] Ask to cancel further downloads To: Pedro Alves Cc: Tom de Vries , gdb-patches@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2022 01:44:24 -0000 On Fri, Sep 30, 2022 at 12:15 PM Pedro Alves 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