From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id abvsOrN1fGoxkyAAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 09:31:31 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZnuLVCZ9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EDB5F1E166; Wed, 12 Aug 2026 09:31:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 816061E033 for ; Wed, 12 Aug 2026 09:31:31 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0496B4BAE7E9 for ; Wed, 12 Aug 2026 13:31:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0496B4BAE7E9 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZnuLVCZ9 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by sourceware.org (Postfix) with ESMTPS id A13364BA9035 for ; Wed, 12 Aug 2026 13:29:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A13364BA9035 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A13364BA9035 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541369; cv=none; b=K2ZjueKf5MQje3yCj7QUko2OxWN20ttqGYxDk1uq0SWMW0T3Ey+Qbl9+j0YpJAzcQJ+qU13xkIE1/UfcX7nWqjMLZGc12i73PxdqHKESashuiWVRJQniMNiFi+WySWt5q8uuMfWC1s7hb1rDx+33xDmyoiYeL7lgNuivkm9Gls8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541369; c=relaxed/simple; bh=626k74HrQwKkUjiZbN3JyGWkyMBn24avlHJHWX2wxr8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sEE5hhFX7fKTlS9viaO3BoRvNhhXcU0O7EKAIAQMbqFuMsQtiy5rYq8AN5FIkeOxRZXSxZKxZVTCgmJwbvTjytlFNEdDqWnncPjlJsukxX7g4nR1Ho5g5cE0uvdUiQ3u4UmSvY3k7aD6tv+/lJS/sDuW8IpXqlOrPVSGi6LaxcA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZnuLVCZ9 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A13364BA9035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786541369; x=1818077369; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=626k74HrQwKkUjiZbN3JyGWkyMBn24avlHJHWX2wxr8=; b=ZnuLVCZ9AksEvUloi2Qy2u3lBjLnvQXXnQLi5jTLzdCnVwFCm7Rbrequ i3zBCOKYSsM2L8NLMZoDuPl06dj1vGS7zBZq0eJAsG0FsyKfZpzDaox6A ezi1IyLiX5UcOE6deoKp8nNd8Fw+rTVjkZVcjhnmGii5IuZ2wLTGrahJB ngVAMWFjdeQK8PgqDJMPHpsj+etKJD66XlNSli7OspD2TWSmM9ZcTYLw4 M1Pkb2NiiM9naVEItx8gb++aOIK38yMv9uPhJ6+upldSHb7CAdTseCyMT 9im/797qQ/PCxH3BrAs0sW5bz9IbHvN27n7S8DL5YUsZ3+DQID25RwsH6 w==; X-CSE-ConnectionGUID: LyfK2n5eSNanhxNINXbKZw== X-CSE-MsgGUID: WCyKKWsqSdy/vQkGx87ggQ== X-IronPort-AV: E=McAfee;i="6800,10657,11872"; a="97757884" X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="97757884" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:29:29 -0700 X-CSE-ConnectionGUID: I4QOLjjRQyqFn76ORDTrPQ== X-CSE-MsgGUID: 9Op9lpDbRfSJLUs0DooG5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="259817942" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:29:28 -0700 From: Markus Metzger To: gdb-patches@sourceware.org Subject: [PATCH v4 26/44] gdb: partially fix C-c not working Date: Wed, 12 Aug 2026 15:27:46 +0200 Message-ID: <20260812132805.380163-27-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260812132805.380163-1-markus.t.metzger@intel.com> References: <20260812132805.380163-1-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org When resuming an inferior without threads, e.g. an Intel GPU device inferior, and then interrupting with C-c, the stop request is not delivered. This appears as a hang. Pedro Alves has a patch series to actually fix this issue. This is a partial workaround to address one instance of this that I encountered. --- gdb/target.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdb/target.c b/gdb/target.c index 5d937f3ae85..a41735ef888 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3830,6 +3830,18 @@ target_pass_ctrlc (void) } } } + + /* Inferior may not (currently) have threads. If we didn't find a + target with running threads, pass it to the current inferior's + target. */ + inferior *inf = current_inferior (); + if (inf != nullptr) + { + inf->top_target ()->pass_ctrlc (); + return; + } + + warning (_("Dropping interrupt request.")); } /* See target.h. */ -- 2.43.0 ________________________________________ Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 (89) 99143-0 www.intel.de Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.