From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uB2QJsL7QWiDUwIAWB0awg (envelope-from ) for ; Thu, 05 Jun 2025 16:19:14 -0400 Received: by simark.ca (Postfix, from userid 112) id 9B8E61E102; Thu, 5 Jun 2025 16:19:14 -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 1C9001E0C2 for ; Thu, 5 Jun 2025 16:19:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D55CA3856DF0 for ; Thu, 5 Jun 2025 20:19:13 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id EED7A385840D for ; Thu, 5 Jun 2025 20:17:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EED7A385840D 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 EED7A385840D 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=1749154628; cv=none; b=veByZ1aESsjsMoYaibYJuTjKWXjkxm0E46UypKWNQoA71WfkZsGvlahE1b3YmiTGH9w14Y4l4pSA3oZYBTF/VAd1S9T01fA9h5IcATkuqaK6K8lGchWBjTSafRE/BJxODwU1ViUQG2OtCrr9e4C3N8HzAMt/+5D6zMkC8PYLL60= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749154628; c=relaxed/simple; bh=I8jniNlA5ykg+B/yh9V7I1I0js5koT50S1OcrD7qZ1I=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Avkx4NeqH5+WPK3GAm1eGeRQboJuSdpFCg76XHRrLdfdS1DJ70L1eVW5buahEBYVvL99f20zk/s+fi9f5wyH0YwU72aKrvH288B6xBm3APQjz0/eJCy7heQdLX/1lVFc69na6T1Eykubxdj8MFB9QLXqpPDpldoKK5xBUkF177I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EED7A385840D Received: by simark.ca (Postfix, from userid 112) id 88A861E12E; Thu, 5 Jun 2025 16:17:05 -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 A991C1E102; Thu, 5 Jun 2025 16:16:59 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Lancelot Six , Simon Marchi Subject: [PATCH 3/5] gdb/amd-dbgapi: pass amd_dbgapi_inferior_info to process_event_queue Date: Thu, 5 Jun 2025 16:16:26 -0400 Message-ID: <20250605201657.418206-3-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 A following patch will make process_event_queue access a field of amd_dbgapi_inferior_info. Prepare for this by making process_event_queue accept an amd_dbgapi_inferior_info object, instead of a process id. Change-Id: I9adc491dd1ff64ff74c40aa7662fffb11bd8332b --- gdb/amd-dbgapi-target.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c index 8fd8bcf5ae49..1ec20d1874ec 100644 --- a/gdb/amd-dbgapi-target.c +++ b/gdb/amd-dbgapi-target.c @@ -234,7 +234,7 @@ struct amd_dbgapi_inferior_info }; static amd_dbgapi_event_id_t process_event_queue - (amd_dbgapi_process_id_t process_id, + (amd_dbgapi_inferior_info &info, amd_dbgapi_event_kind_t until_event_kind = AMD_DBGAPI_EVENT_KIND_NONE); static const target_info amd_dbgapi_target_info = { @@ -564,8 +564,7 @@ amd_dbgapi_target_breakpoint::check_status (struct bpstat *bs) /* If the action is AMD_DBGAPI_BREAKPOINT_ACTION_HALT, we need to wait until a breakpoint resume event for this breakpoint_id is seen. */ amd_dbgapi_event_id_t resume_event_id - = process_event_queue (info->process_id, - AMD_DBGAPI_EVENT_KIND_BREAKPOINT_RESUME); + = process_event_queue (*info, AMD_DBGAPI_EVENT_KIND_BREAKPOINT_RESUME); /* We should always get a breakpoint_resume event after processing all events generated by reporting the breakpoint hit. */ @@ -1337,28 +1336,22 @@ event_kind_str (amd_dbgapi_event_kind_t kind) gdb_assert_not_reached ("unhandled amd_dbgapi_event_kind_t value"); } -/* Drain the dbgapi event queue of a given process_id, or of all processes if - process_id is AMD_DBGAPI_PROCESS_NONE. Stop processing the events if an - event of a given kind is requested and `process_id` is not - AMD_DBGAPI_PROCESS_NONE. Wave stop events that are not returned are queued - into their inferior's amd_dbgapi_inferior_info pending wave events. */ +/* Drain the dbgapi event queue of a given process_id. Stop processing the + events if an event of a given kind is requested (not AMD_DBGAPI_EVENT_NONE). + Wave stop events that are not returned are queued into their inferior's + amd_dbgapi_inferior_info pending wave events. */ static amd_dbgapi_event_id_t -process_event_queue (amd_dbgapi_process_id_t process_id, +process_event_queue (amd_dbgapi_inferior_info &info, amd_dbgapi_event_kind_t until_event_kind) { - /* An event of a given type can only be requested from a single - process_id. */ - gdb_assert (until_event_kind == AMD_DBGAPI_EVENT_KIND_NONE - || process_id != AMD_DBGAPI_PROCESS_NONE); - while (true) { amd_dbgapi_event_id_t event_id; amd_dbgapi_event_kind_t event_kind; amd_dbgapi_status_t status - = amd_dbgapi_process_next_pending_event (process_id, &event_id, + = amd_dbgapi_process_next_pending_event (info.process_id, &event_id, &event_kind); if (status != AMD_DBGAPI_STATUS_SUCCESS) @@ -1479,7 +1472,7 @@ amd_dbgapi_target::wait (ptid_t ptid, struct target_waitstatus *ws, /* Drain the events for the current inferior from the amd_dbgapi and preserve the ordering. */ auto info = get_amd_dbgapi_inferior_info (current_inferior ()); - process_event_queue (info->process_id); + process_event_queue (*info); std::tie (event_ptid, gpu_waitstatus) = consume_one_event (ptid.pid ()); if (event_ptid == minus_one_ptid) -- 2.49.0