Fix TestVSCode_runInTerminal
authorWalter Erquinigo <a20012251@gmail.com>
Wed, 21 Apr 2021 22:20:42 +0000 (15:20 -0700)
committerWalter Erquinigo <a20012251@gmail.com>
Wed, 21 Apr 2021 22:20:47 +0000 (15:20 -0700)
It failed in https://lab.llvm.org/buildbot/#/builders/68/builds/10912

And it was caused due to https://reviews.llvm.org/rG64f47c1e58a1

lldb/tools/lldb-vscode/lldb-vscode.cpp

index b810bf7..95074bb 100644 (file)
@@ -3149,9 +3149,6 @@ int main(int argc, char *argv[]) {
   llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
   llvm::PrettyStackTraceProgram X(argc, argv);
 
-  // stdout/stderr redirection to the IDE's console
-  int new_stdout_fd = SetupStdoutStderrRedirection();
-
   llvm::SmallString<256> program_path(argv[0]);
   llvm::sys::fs::make_absolute(program_path);
   g_vsc.debug_adaptor_path = program_path.str().str();
@@ -3178,6 +3175,9 @@ int main(int argc, char *argv[]) {
     }
   }
 
+  // stdout/stderr redirection to the IDE's console
+  int new_stdout_fd = SetupStdoutStderrRedirection();
+
   // Initialize LLDB first before we do anything.
   lldb::SBDebugger::Initialize();