From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id d7tbOI3hPGNyvgUAWB0awg (envelope-from ) for ; Tue, 04 Oct 2022 21:44:45 -0400 Received: by simark.ca (Postfix, from userid 112) id D91001E112; Tue, 4 Oct 2022 21:44:45 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=KcpWTWJl; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 85F2F1E0D3 for ; Tue, 4 Oct 2022 21:44:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 772BC3858290 for ; Wed, 5 Oct 2022 01:44:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 772BC3858290 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664934284; bh=Tdd6d3KnIjdQd22yEycq4lPi3vYQtWi10kND2d6vVag=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KcpWTWJl1eojBrkDneXnFlq1MMMtORP4uM/i19WwLqGCpU/RvE/ytgAQkvE3V17jx fwPm7Wwet4wy2QG/o38pckqY6CcgMZxdFsooX4idHAOdYGPmTW2hBXHhQ08KA808I3 6BSiqHhYhsSm7WT6fakPM3ywAcPmwfpA3Ns6wGnU= 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> Date: Tue, 4 Oct 2022 21:44:08 -0400 Message-ID: Subject: Re: [PATCH][gdb/debuginfod] Ask to cancel further downloads To: Pedro Alves X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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: , From: Aaron Merey via Gdb-patches Reply-To: Aaron Merey Cc: Tom de Vries , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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