From 3453170913ea315757d8087f1adbc6366b903924 Mon Sep 17 00:00:00 2001 From: David Peixotto Date: Tue, 26 Aug 2025 19:07:05 -0700 Subject: [PATCH] Call notify on StateSync condition variable when resuming We are currently missing a call to notify threads waiting on the StateSync condition variable when resuming the process. This causes the native process to miss out on notifications that the gpu process has resumed when waiting for the gpu to process to hit its requested stop id when `wait_for_gpu_process_to_resume` is true in GPUActions. --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 3 +-- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 90c67ea87ec40..d30cf5592fc0b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -6397,8 +6397,7 @@ void ProcessGDBRemote::SyncState::SetStateStopped(uint64_t stop_id) { void ProcessGDBRemote::SyncState::DidResume() { Log *log = GetLog(GDBRLog::Plugin); - std::lock_guard guard(m_mutex); - m_state = lldb::eStateRunning; + SetStateImpl(m_stop_id, lldb::eStateRunning); LLDB_LOG(log, "pid = {}, SyncState::{}() m_stop_id = {}, m_state = {}", m_process.GetID(), __FUNCTION__, m_stop_id, StateAsCString(m_state.value_or(lldb::eStateInvalid))); diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 760686767fac5..116bf4f3ef0c0 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -63,7 +63,7 @@ class ProcessGDBRemote : public Process, std::optional m_stop_id; std::optional m_state; - void SetStateImpl(uint64_t stop_id, lldb::StateType state) { + void SetStateImpl(std::optional stop_id, lldb::StateType state) { // Scope to ensure the lock is released prior to calling notify. { std::lock_guard guard(m_mutex);