[Lldb-commits] [lldb] dfc8da1 - [lldb] Remove LLDB_CAPTURE_REPRODUCER override

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 31 21:11:02 PDT 2021


Author: Jonas Devlieghere
Date: 2021-03-31T21:10:56-07:00
New Revision: dfc8da19c5d7ed48f62a4cc588b641f2deee8789

URL: https://github.com/llvm/llvm-project/commit/dfc8da19c5d7ed48f62a4cc588b641f2deee8789
DIFF: https://github.com/llvm/llvm-project/commit/dfc8da19c5d7ed48f62a4cc588b641f2deee8789.diff

LOG: [lldb] Remove LLDB_CAPTURE_REPRODUCER override

Remove the LLDB_CAPTURE_REPRODUCER as it is inherently dangerous. The
reproducers require careful initialization which cannot be guaranteed by
overwriting the reproducer mode at this level.

If we want to provide this functionality, we should do it in the driver
instead. It was originally added to enable capture in CI, but we now
have a dedicated CI job that captures and replays the test suite.

Added: 
    

Modified: 
    lldb/source/Utility/Reproducer.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp
index d9207b1eb49f3..b63863c535faf 100644
--- a/lldb/source/Utility/Reproducer.cpp
+++ b/lldb/source/Utility/Reproducer.cpp
@@ -20,15 +20,6 @@ using namespace lldb_private::repro;
 using namespace llvm;
 using namespace llvm::yaml;
 
-static llvm::Optional<bool> GetEnv(const char *var) {
-  std::string val = llvm::StringRef(getenv(var)).lower();
-  if (val == "0" || val == "off")
-    return false;
-  if (val == "1" || val == "on")
-    return true;
-  return {};
-}
-
 Reproducer &Reproducer::Instance() { return *InstanceImpl(); }
 
 llvm::Error Reproducer::Initialize(ReproducerMode mode,
@@ -36,16 +27,6 @@ llvm::Error Reproducer::Initialize(ReproducerMode mode,
   lldbassert(!InstanceImpl() && "Already initialized.");
   InstanceImpl().emplace();
 
-  // The environment can override the capture mode.
-  if (mode != ReproducerMode::Replay) {
-    if (llvm::Optional<bool> override = GetEnv("LLDB_CAPTURE_REPRODUCER")) {
-      if (*override)
-        mode = ReproducerMode::Capture;
-      else
-        mode = ReproducerMode::Off;
-    }
-  }
-
   switch (mode) {
   case ReproducerMode::Capture: {
     if (!root) {


        


More information about the lldb-commits mailing list