[Lldb-commits] [lldb] r360371 - Fix TestVSCode_attach on Linux

Stella Stamenova via lldb-commits lldb-commits at lists.llvm.org
Thu May 9 12:49:26 PDT 2019


Author: stella.stamenova
Date: Thu May  9 12:49:26 2019
New Revision: 360371

URL: http://llvm.org/viewvc/llvm-project?rev=360371&view=rev
Log:
Fix TestVSCode_attach on Linux

The test is failing sometimes because the debugger is failing to attach for lack of permissions. The fix is to call lldb_enable_attach inside the inferior main function

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/main.c

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/main.c?rev=360371&r1=360370&r2=360371&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/main.c (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/main.c Thu May  9 12:49:26 2019
@@ -1,8 +1,11 @@
 #include <stdio.h>
 #include <unistd.h>
 
-int main(int argc, char const *argv[]) {
-  printf("pid = %i\n", getpid());
-  sleep(10);
-  return 0; // breakpoint 1
+int main(int argc, char const *argv[])
+{
+    lldb_enable_attach();
+
+    printf("pid = %i\n", getpid());
+    sleep(10);
+    return 0; // breakpoint 1
 }




More information about the lldb-commits mailing list