From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by sourceware.org (Postfix) with ESMTPS id 30F313858D1E for ; Fri, 30 Sep 2022 16:15:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30F313858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id e18so3225039wmq.3 for ; Fri, 30 Sep 2022 09:15:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date; bh=KKQGPOeJlQEPZQ4E0wmemsvohpfxU8lIZoy+i8SZVbg=; b=QC7Vulyfhk/kjq3ke8UuNd9sKMGsABY07I0yPVxbSEKt6qFjuhP4jNjnD5PuvABD0Y sq4HzPwGtu0pxvdAP2CFX8B1vQCLxFnFiWvcYZco6ryHpgsAgboRbb0H0Ti49NiTkd0k s1eJ8K5EpoODBnNkXkJ/adIhpJchvoh8g572Hb7tgvJSh9lMi4lPlyl70UCGaY9NY3fW LwvqmwMjLzJSXPLeF0A5/ncy+dssRG+1P3qvzeqo+6BryK9kbSuFhtq21l7fAuYRhDab bqzj3xlOhF1WnaXnowoInQj4yQflS8HOZrECmR0OWlOBo3m7mgNuoYCdzk8uXTmID71a DXJg== X-Gm-Message-State: ACrzQf07uep/T7o35A9St0DPO0NPggFOanRP+kUPiLXCsl1i8+h47Ay0 c9ZNACGQnrCmfwsho4DRkU67hPhKJpM7qA== X-Google-Smtp-Source: AMsMyM4CNxNfKSoPseRpdBF0qdzBuNcNcI7ATYOi/gEAfLAk4MAlD41xYBXieHOW/1lC4jdXIbVhSg== X-Received: by 2002:a05:600c:21c4:b0:3b4:9668:d3d5 with SMTP id x4-20020a05600c21c400b003b49668d3d5mr14681420wmj.155.1664554506353; Fri, 30 Sep 2022 09:15:06 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id bz5-20020a056000090500b00228de351fc0sm2405334wrb.38.2022.09.30.09.15.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Sep 2022 09:15:05 -0700 (PDT) Subject: Re: [PATCH][gdb/debuginfod] Ask to cancel further downloads To: Aaron Merey , Tom de Vries Cc: gdb-patches@sourceware.org References: <20220929082534.GA22465@delia.home> From: Pedro Alves Message-ID: <697074fa-9813-70b9-6bd7-f1796428f1e7@palves.net> Date: Fri, 30 Sep 2022 17:15:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, 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: Fri, 30 Sep 2022 16:15:09 -0000 On 2022-09-29 8:29 p.m., Aaron Merey via Gdb-patches wrote: > On Thu, Sep 29, 2022 at 4:34 AM Tom de Vries wrote: >> Add a new command "set debuginfod cancel one/all/ask", where: >> - "one" means ^C cancels one download, >> - "all" means ^C cancels all further downloads, and >> - "ask" means ^C asks whether to cancel all further downloads. A "yes" implies >> "set debuginfod cancel all", and a "no" implies "set debuginfod cancel one", so >> the question is only asked once. >> >> Note that the behaviour as it was before this patch is equivalent to >> "set debuginfod cancel one". >> >> Instead, the new default is "set debuginfod cancel ask". >> >> Note that cancelling all further downloads implies "set debuginfod enabled off". > > LGTM. It's a usability improvement and it worked as intended during testing. 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? 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? Pedro Alves