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

We need to do this before we create the debugger because the commands run in 
the lldbinit might do output to these handlers as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70886

Files:
  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,14 +1194,6 @@
 //   }]
 // }
 void request_initialize(const llvm::json::Object &request) {
-  auto arguments = request.getObject("arguments");
-  const auto skipInitFiles = GetBoolean(arguments, "skipInitFiles", false);
-  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"
-  // request.
   FILE *out = llvm::sys::RetryAfterSignal(nullptr, fopen, dev_null_path, "w");
   if (out) {
     // Set the output and error file handles to redirect into nothing otherwise
@@ -1212,6 +1204,14 @@
     g_vsc.debugger.SetErrorFileHandle(out, false);
   }
 
+  auto arguments = request.getObject("arguments");
+  const auto skipInitFiles = GetBoolean(arguments, "skipInitFiles", false);
+  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"
+  // request.
   g_vsc.target = g_vsc.debugger.CreateTarget(nullptr);
   lldb::SBListener listener = g_vsc.debugger.GetListener();
   listener.StartListeningForEvents(


Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===================================================================
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1194,14 +1194,6 @@
 //   }]
 // }
 void request_initialize(const llvm::json::Object &request) {
-  auto arguments = request.getObject("arguments");
-  const auto skipInitFiles = GetBoolean(arguments, "skipInitFiles", false);
-  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"
-  // request.
   FILE *out = llvm::sys::RetryAfterSignal(nullptr, fopen, dev_null_path, "w");
   if (out) {
     // Set the output and error file handles to redirect into nothing otherwise
@@ -1212,6 +1204,14 @@
     g_vsc.debugger.SetErrorFileHandle(out, false);
   }
 
+  auto arguments = request.getObject("arguments");
+  const auto skipInitFiles = GetBoolean(arguments, "skipInitFiles", false);
+  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"
+  // request.
   g_vsc.target = g_vsc.debugger.CreateTarget(nullptr);
   lldb::SBListener listener = g_vsc.debugger.GetListener();
   listener.StartListeningForEvents(
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to