[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
Tue Apr 16 09:26:27 PDT 2024


================
@@ -0,0 +1,48 @@
+#include "pseudo_barrier.h"
+#include <chrono>
+#include <fcntl.h>
+#include <fstream>
+#include <stdio.h>
+#include <thread>
+#include <vector>
+
+pseudo_barrier_t barrier;
+
+constexpr size_t nthreads = 5;
+volatile bool wait_for_debugger_flag = true;
+
+void break_here() {}
+
+void tfunc() {
+  pseudo_barrier_wait(barrier);
+
+  break_here();
+}
+
+int main(int argc, char const *argv[]) {
+  lldb_enable_attach();
----------------
jeffreytan81 wrote:

Just curious, why this is needed? 
Is it that some special OS may restrict the default attaching behavior for security reason unless lldb_enable_attach() is explicitly called?  

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


More information about the lldb-commits mailing list