diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 17c7742549b7d6..b3d14e64e647ff 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -951,9 +951,11 @@ Status ProcessGDBRemote::HandleConnectionRequest(const GPUActions &gpu_action) { return Status::FromErrorString("invalid platform for target needed for " "connecting to process"); - ProcessSP process_sp = platform_sp->ConnectProcess( + // We wait for the process to fully stop before we can query or alter it via + // GPUActions. + ProcessSP process_sp = platform_sp->ConnectProcessSynchronous( connection_info.connect_url, GetPluginNameStatic(), debugger, - gpu_target_sp.get(), error); + *debugger.GetAsyncOutputStream(), gpu_target_sp.get(), error); if (error.Fail()) return error; if (!process_sp)