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 1E1633858D28 for ; Tue, 14 Dec 2021 22:32:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1E1633858D28 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-240-dojffkIaOGmvkHofC-4dZQ-1; Tue, 14 Dec 2021 17:32:35 -0500 X-MC-Unique: dojffkIaOGmvkHofC-4dZQ-1 Received: by mail-qv1-f72.google.com with SMTP id g15-20020a0562141ccf00b003cada9e7e2fso28853769qvd.1 for ; Tue, 14 Dec 2021 14:32:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sHJxR4yXdx4jJd4k4xvLQ7KDcL8PYfQXB6CrtZS4xh0=; b=r1BmJ4ANtogAozXYVPGzA8IXHeccoimS3dUqC46ykhcE6TO3DH5AfrdkGCaFK0hXvd +5ac95otw91iDsfwbpyiBiOYobvOv7wvbsEaLbK2tlodM0252RnRN6gt35g2o14iir4X dnwPPCSUtlckEXyyKOLMsAoeqGqDPn2FeOs0qONcEIWPh/kkvlGoMxk6sVrrDCEx3uRj 8VRu+ervksZG9FN7WSfWBDZotPWQGKmpp0FD0TuVnjAzKVKSpYK4at82t55PRlXI3XGI t/0E73uNeWGxXl/oyKHZKZMsSE6HQeh7LablaevPN+nECc0kfB/Olt8qSecVto4pJUGl vEMw== X-Gm-Message-State: AOAM531uWfWmy9NlZ8LJeWWckft7E89vptAQpzsBarOeK+6xATftXTdU rFF9oIEZo4lPqcTmntM6K+EFTdvThLmyYgM6CIawnrkl2R7LeayOmmjBwSO2tjBYfYh1SXXq0wZ wivU4GBhO9r4DjVcwU7EBBu4etwc7YcwJ3Y6K X-Received: by 2002:ad4:5cef:: with SMTP id iv15mr8549579qvb.102.1639521155186; Tue, 14 Dec 2021 14:32:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBlGc7dZ5Gb4HDkP6o6tw+PLepoM9nqWMIVoe7NKib5tgiQstNZvNBY2uauPDJ7eXngN8G1roYRyYoMI2W2is= X-Received: by 2002:ad4:5cef:: with SMTP id iv15mr8549566qvb.102.1639521154958; Tue, 14 Dec 2021 14:32:34 -0800 (PST) MIME-Version: 1.0 References: <20211124014314.217675-1-amerey@redhat.com> <87lf1470k1.fsf@tromey.com> In-Reply-To: <87lf1470k1.fsf@tromey.com> From: Aaron Merey Date: Tue, 14 Dec 2021 17:32:24 -0500 Message-ID: Subject: Re: [PATCH] [PR gdb/27026] CTRL-C is ignored when debug info is downloaded To: Tom Tromey Cc: Aaron Merey via Gdb-patches , Tom de Vries X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 14 Dec 2021 22:32:40 -0000 Hi Tom, On Wed, Dec 1, 2021 at 11:45 AM Tom Tromey wrote: > > >>>>> "Aaron" == Aaron Merey via Gdb-patches writes: > > Aaron> + gdb::optional term_state; > Aaron> + if (target_supports_terminal_ours ()) > Aaron> + { > Aaron> + term_state.emplace (); > Aaron> + target_terminal::ours (); > Aaron> + } > > I was curious to know if the gdb::optional and the > target_supports_terminal_ours checks are really needed here. > I think plenty of spots do this stuff unconditionally, so I > was wondering if this code has some special need. These checks came from Tom's draft of this patch. AFAICT it's done out of an abundance of caution in case this code runs before any inferior is loaded. I'm not sure that is currently possible but I think it's better to be safe than sorry here. Aaron