[Lldb-commits] [lldb] New ThreadPlanSingleThreadTimeout to resolve potential deadlock in single thread stepping (PR #90930)

via lldb-commits lldb-commits at lists.llvm.org
Mon May 6 11:17:33 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff cf3c714e4bd7b8a68793f2827080fe3388ae8bb1 d125c5a761a70b024afb16d22b4326df4071e04b -- lldb/include/lldb/Target/ThreadPlanSingleThreadTimeout.h lldb/source/Target/ThreadPlanSingleThreadTimeout.cpp lldb/test/API/functionalities/single-thread-step/main.cpp lldb/include/lldb/Target/Process.h lldb/include/lldb/Target/StopInfo.h lldb/include/lldb/Target/Thread.h lldb/include/lldb/Target/ThreadPlan.h lldb/include/lldb/Target/ThreadPlanStepOut.h lldb/include/lldb/Target/ThreadPlanStepOverRange.h lldb/include/lldb/Target/ThreadPlanStepRange.h lldb/include/lldb/lldb-enumerations.h lldb/source/API/SBThread.cpp lldb/source/Interpreter/CommandInterpreter.cpp lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/source/Target/Process.cpp lldb/source/Target/StopInfo.cpp lldb/source/Target/Thread.cpp lldb/source/Target/ThreadPlan.cpp lldb/source/Target/ThreadPlanStepInRange.cpp lldb/source/Target/ThreadPlanStepOverRange.cpp lldb/source/Target/ThreadPlanStepRange.cpp lldb/tools/lldb-dap/JSONUtils.cpp lldb/tools/lldb-dap/LLDBUtils.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Target/ThreadPlanSingleThreadTimeout.cpp b/lldb/source/Target/ThreadPlanSingleThreadTimeout.cpp
index ce214af233..00f6923446 100644
--- a/lldb/source/Target/ThreadPlanSingleThreadTimeout.cpp
+++ b/lldb/source/Target/ThreadPlanSingleThreadTimeout.cpp
@@ -75,10 +75,7 @@ void ThreadPlanSingleThreadTimeout::CreateNew(Thread &thread) {
 
   if (ThreadPlanSingleThreadTimeout::IsAlive())
     return;
-  {
-    
-    s_prev_state = State::WaitTimeout;
-  }
+  { s_prev_state = State::WaitTimeout; }
   auto timeout_plan = new ThreadPlanSingleThreadTimeout(thread);
   ThreadPlanSP thread_plan_sp(timeout_plan);
   auto status = thread.QueueThreadPlan(thread_plan_sp,
@@ -230,5 +227,5 @@ void ThreadPlanSingleThreadTimeout::HandleTimeout() {
 
 bool ThreadPlanSingleThreadTimeout::IsAlive() {
   std::lock_guard<std::mutex> lock(s_mutex);
-  return s_instance != nullptr; 
+  return s_instance != nullptr;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/90930


More information about the lldb-commits mailing list