From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id S0dkNVz7QWiDUwIAWB0awg (envelope-from ) for ; Thu, 05 Jun 2025 16:17:32 -0400 Received: by simark.ca (Postfix, from userid 112) id C88E81E102; Thu, 5 Jun 2025 16:17:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6B9591E0C2 for ; Thu, 5 Jun 2025 16:17:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 180FF3856DE3 for ; Thu, 5 Jun 2025 20:17:32 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id EA98F3857706 for ; Thu, 5 Jun 2025 20:17:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA98F3857706 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EA98F3857706 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749154627; cv=none; b=lwexc957aRaZEFmu18vxUfMI4dxe5SEiFZ4BM/Qh6l4hz9Qjszjnb6dawqpVschxooLObwMkV5tm2XvgrgzrqhI0I4gl5ykT7RFC9jziu9EnrkzJv014oyrbqp1pM/BI6scMutO3wckQik6eVcSsJ57lC+rYCEud9+0s8Gu/2Ys= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749154627; c=relaxed/simple; bh=MlSgmsdgTP4fyObCMFaKgbLoksRGPuu8fgZteGNzrl0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=SSyAt57JuzlG2frNj17LbvOVawYPU0U8ihP7wpOeGNH51DWMnEBjjbOkb774eMtk4ov6+PpoqP73XSLG0EhZT9vvSSaUtNjQV6Ss8Fd2zDMSl5PScqT4HTqV+jM1njAFox9lWM9iC32ojuPx+TXyDOA9v43FmaPvQQlSgQBnTTQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by simark.ca (Postfix, from userid 112) id 951B61E128; Thu, 5 Jun 2025 16:17:03 -0400 (EDT) Received: from localhost.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 ESMTPSA id 6FD491E100; Thu, 5 Jun 2025 16:16:59 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Lancelot Six , Simon Marchi Subject: [PATCH 2/5] gdb/amd-dbgapi: add assert in require_forward_progress Date: Thu, 5 Jun 2025 16:16:25 -0400 Message-ID: <20250605201657.418206-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250605201657.418206-1-simon.marchi@efficios.com> References: <20250605201657.418206-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 I didn't have a problem in this area, but it seems to me that this pre-condition should always hold. We should only disable forward progress requirement if the target says it's ok to do so. Otherwise, we could get in a situation where we wait for events from amd-dbgapi, which will never arrive, because amd-dbgapi didn't actually resume things. Change-Id: Ifc49f55c7874924b7c47888b8391a07a01d960fc --- gdb/amd-dbgapi-target.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c index c11e834aa408..8fd8bcf5ae49 100644 --- a/gdb/amd-dbgapi-target.c +++ b/gdb/amd-dbgapi-target.c @@ -450,6 +450,12 @@ static void require_forward_progress (ptid_t ptid, process_stratum_target *proc_target, bool require) { + /* If we try to disable forward progress requirement but the target expects + resumed threads to be committed to the target, we could wait for events + that will never arrive. */ + if (!require) + gdb_assert (!proc_target->commit_resumed_state); + for (inferior *inf : all_inferiors (proc_target)) { if (ptid != minus_one_ptid && inf->pid != ptid.pid ()) -- 2.49.0