From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZLwrGIwHR2gLNQcAWB0awg (envelope-from ) for ; Mon, 09 Jun 2025 12:10:52 -0400 Received: by simark.ca (Postfix, from userid 112) id 411FC1E11E; Mon, 9 Jun 2025 12:10:52 -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 B389F1E0C2 for ; Mon, 9 Jun 2025 12:10:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DC5838306A6 for ; Mon, 9 Jun 2025 16:10:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DC5838306A6 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 8EB7C382D47F for ; Mon, 9 Jun 2025 16:10:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8EB7C382D47F 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 8EB7C382D47F 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=1749485411; cv=none; b=DVmeGZlzoQPpEfgMNVCbut3p7uIfiX95L2sxZlU6NntfOBGS/7qmig3n/XLxmqRADpIo3SeWdchAfRzgon25LPH4KeGsmwz0GEzAgU4qq6CLK00A8XDJuOYovazaMEl5NmRZB+6qdRDXc9LA9h2M7cNyjCNSeEbkc87+AVvgCu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749485411; c=relaxed/simple; bh=QCIfIt7zdodfRJCwLJjqFS95NBrIKcTWmoTbStb7xPA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=RzFdnWNCCDvhDFjPWZICGxZh/PgDe+hLS4doNOulhICNk5djnx6qna68dIq6AcHKUYMMmVxaELfbwL0Ra3CXJNQZdqcS3JlXHM3mBEIEyRjtXuRK1OSwfDcaV0UQzCvvJ+lEW3PqXI/5kZUK/slb6xTGm100DEKyJC5pOz6xvQ0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EB7C382D47F Received: by simark.ca (Postfix, from userid 112) id 2AAE81E13A; Mon, 9 Jun 2025 12:10:11 -0400 (EDT) Received: from smarchi-efficios.internal.efficios.com (192-222-132-26.qc.cable.ebox.net [192.222.132.26]) (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 D3A451E100; Mon, 9 Jun 2025 12:10:06 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Lancelot Six , Simon Marchi , Lancelot Six Subject: [PATCH v2 2/6] gdb/amd-dbgapi: add assert in require_forward_progress Date: Mon, 9 Jun 2025 12:08:58 -0400 Message-ID: <20250609161004.97787-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250609161004.97787-1-simon.marchi@efficios.com> References: <20250609161004.97787-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 Approved-by: Lancelot Six --- 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 2aa9d2a03a4b..32a3f6d3c334 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