aadsm created this revision.
aadsm added reviewers: clayborg, lanza, wallace.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

lldb has the -x option but this doesn't exist at all for lldb-vscode. To be 
honest my main goal is the ability to run the lldb-vscode tests without an 
lldbinit file polluting it. 
The DAP doesn't seem to have it 
(https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Initialize)
 but it does seems like a good option to have overall.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70882

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/tools/lldb-vscode/lldb-vscode.cpp


Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===================================================================
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1194,7 +1194,10 @@
 //   }]
 // }
 void request_initialize(const llvm::json::Object &request) {
-  g_vsc.debugger = lldb::SBDebugger::Create(true /*source_init_files*/);
+  auto arguments = request.getObject("arguments");
+  const auto skipInitFiles = GetBoolean(arguments, "skipInitFiles", true);
+  g_vsc.debugger =
+      lldb::SBDebugger::Create(!skipInitFiles /*source_init_files*/);
   // Create an empty target right away since we might get breakpoint requests
   // before we are given an executable to launch in a "launch" request, or a
   // executable when attaching to a process by process ID in a "attach"
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -548,7 +548,8 @@
                 'pathFormat': 'path',
                 'supportsRunInTerminalRequest': True,
                 'supportsVariablePaging': True,
-                'supportsVariableType': True
+                'supportsVariableType': True,
+                'skipInitFiles': True,
             }
         }
         response = self.send_recv(command_dict)


Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===================================================================
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1194,7 +1194,10 @@
 //   }]
 // }
 void request_initialize(const llvm::json::Object &request) {
-  g_vsc.debugger = lldb::SBDebugger::Create(true /*source_init_files*/);
+  auto arguments = request.getObject("arguments");
+  const auto skipInitFiles = GetBoolean(arguments, "skipInitFiles", true);
+  g_vsc.debugger =
+      lldb::SBDebugger::Create(!skipInitFiles /*source_init_files*/);
   // Create an empty target right away since we might get breakpoint requests
   // before we are given an executable to launch in a "launch" request, or a
   // executable when attaching to a process by process ID in a "attach"
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -548,7 +548,8 @@
                 'pathFormat': 'path',
                 'supportsRunInTerminalRequest': True,
                 'supportsVariablePaging': True,
-                'supportsVariableType': True
+                'supportsVariableType': True,
+                'skipInitFiles': True,
             }
         }
         response = self.send_recv(command_dict)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to