From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5bwAG8+YnWFuQAAAWB0awg (envelope-from ) for ; Tue, 23 Nov 2021 20:43:43 -0500 Received: by simark.ca (Postfix, from userid 112) id 560AD1F0CE; Tue, 23 Nov 2021 20:43:43 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 D28561EDEE for ; Tue, 23 Nov 2021 20:43:42 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19FD53858409 for ; Wed, 24 Nov 2021 01:43:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19FD53858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637718222; bh=T+bNx22TzyBx7ifIR7ZGCHi91bkdGIAjCJErVDQueQQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=AYbMrSQsmX5kqHvmBOvxVJNpoQJbYTbSy1oZUmPA3jDiCpUywVgWP0JhwtGs9ObM8 SSJOSWBUfGeAv27Vj7Wxc6iehDBnx6FvNLDx0Ni3dULts5YDEgBNEKlWSIQPONzM47 sRcYE0v82A+9fhMet6z5nxQJI6+5PWyBOXms19A4= 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 E490B3858D28 for ; Wed, 24 Nov 2021 01:43:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E490B3858D28 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-268-rDXGprMGOduzLrHlzpQnYQ-1; Tue, 23 Nov 2021 20:43:22 -0500 X-MC-Unique: rDXGprMGOduzLrHlzpQnYQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0E271842BE3; Wed, 24 Nov 2021 01:43:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.18.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 663CF67848; Wed, 24 Nov 2021 01:43:16 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH] [PR gdb/27026] CTRL-C is ignored when debug info is downloaded Date: Tue, 23 Nov 2021 20:43:14 -0500 Message-Id: <20211124014314.217675-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" During debuginfod downloads, ctrl-c should result in the download being cancelled and skipped. However in some cases, ctrl-c fails to get delivered to gdb during downloading. This can result in downloads being unskippable. Fix this by ensuring that target_terminal::ours is in effect for the duration of each download. Co-authored-by: Tom de Vries https://sourceware.org/bugzilla/show_bug.cgi?id=27026#c3 --- gdb/debuginfod-support.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index 2e1837da949..1f160e29714 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -23,6 +23,7 @@ #include "gdbsupport/gdb_optional.h" #include "cli/cli-cmds.h" #include "cli/cli-style.h" +#include "target.h" /* Set/show debuginfod commands. */ static cmd_list_element *set_debuginfod_prefix_list; @@ -204,6 +205,13 @@ debuginfod_source_query (const unsigned char *build_id, user_data data ("source file", srcpath); debuginfod_set_user_data (c, &data); + gdb::optional term_state; + if (target_supports_terminal_ours ()) + { + term_state.emplace (); + target_terminal::ours (); + } + scoped_fd fd (debuginfod_find_source (c, build_id, build_id_len, @@ -242,6 +250,13 @@ debuginfod_debuginfo_query (const unsigned char *build_id, user_data data ("separate debug info for", filename); debuginfod_set_user_data (c, &data); + gdb::optional term_state; + if (target_supports_terminal_ours ()) + { + term_state.emplace (); + target_terminal::ours (); + } + scoped_fd fd (debuginfod_find_debuginfo (c, build_id, build_id_len, &dname)); debuginfod_set_user_data (c, nullptr); -- 2.33.1