[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 12 03:10:51 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 b88a1dd6c75754ace4abe18c8ea16a019f7b5529 9e1aca01da4a4aa5039c6ac1f8320f8c7d85b8e3 -- lldb/test/API/commands/process/detach-resumes/main.cpp lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
``````````

</details>

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

``````````diff
diff --git a/lldb/test/API/commands/process/detach-resumes/main.cpp b/lldb/test/API/commands/process/detach-resumes/main.cpp
index 728ebbff58..e8050fef2c 100644
--- a/lldb/test/API/commands/process/detach-resumes/main.cpp
+++ b/lldb/test/API/commands/process/detach-resumes/main.cpp
@@ -1,9 +1,9 @@
-#include <stdio.h>
-#include <fcntl.h>
-#include <chrono>
-#include <thread>
 #include "pseudo_barrier.h"
+#include <chrono>
+#include <fcntl.h>
 #include <fstream>
+#include <stdio.h>
+#include <thread>
 #include <vector>
 
 pseudo_barrier_t barrier;
@@ -19,11 +19,11 @@ void tfunc() {
   break_here();
 }
 
-int main(int argc, char const *argv[])
-{
+int main(int argc, char const *argv[]) {
   lldb_enable_attach();
 
-  if (argc<3) return 1;
+  if (argc < 3)
+    return 1;
 
   // Create a file to signal that this process has started up.
   std::ofstream(argv[1]).close();
@@ -35,9 +35,11 @@ int main(int argc, char const *argv[])
   // Fire up the threads and have them call break_here() simultaneously.
   pseudo_barrier_init(barrier, nthreads);
   std::vector<std::thread> threads;
-  for(size_t i = 0; i < nthreads; ++i) threads.emplace_back(tfunc);
+  for (size_t i = 0; i < nthreads; ++i)
+    threads.emplace_back(tfunc);
 
-  for(std::thread &t: threads) t.join();
+  for (std::thread &t : threads)
+    t.join();
 
   // Create the file to let the debugger know we're running.
   std::ofstream(argv[2]).close();

``````````

</details>


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


More information about the lldb-commits mailing list