summaryrefslogtreecommitdiffstats
path: root/lldb/source/Initialization/SystemInitializerCommon.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-02-21 22:26:16 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-02-21 22:26:16 +0000
commit936c62422f5dc2d493978f1b99e2218016d8ea13 (patch)
tree9f3ba4139206711f46f88ca7779245a9a8407bbb /lldb/source/Initialization/SystemInitializerCommon.cpp
parentecfac6cd2ce0421a48c2e878e8efe745afd0b2e8 (diff)
downloadbcm5719-llvm-936c62422f5dc2d493978f1b99e2218016d8ea13.tar.gz
bcm5719-llvm-936c62422f5dc2d493978f1b99e2218016d8ea13.zip
[Reproducers] Initialize reproducers before initializing the debugger.
As per the discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-20190218/048007.html This commit implements option (3): > Go back to initializing the reproducer before the rest of the debugger. > The method wouldn't be instrumented and guarantee no other SB methods are > called or SB objects are constructed. The initialization then becomes part > of the replay. Differential revision: https://reviews.llvm.org/D58410 llvm-svn: 354631
Diffstat (limited to 'lldb/source/Initialization/SystemInitializerCommon.cpp')
-rw-r--r--lldb/source/Initialization/SystemInitializerCommon.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lldb/source/Initialization/SystemInitializerCommon.cpp b/lldb/source/Initialization/SystemInitializerCommon.cpp
index 173d48308c6..f69f5b0bf59 100644
--- a/lldb/source/Initialization/SystemInitializerCommon.cpp
+++ b/lldb/source/Initialization/SystemInitializerCommon.cpp
@@ -41,8 +41,7 @@ SystemInitializerCommon::SystemInitializerCommon() {}
SystemInitializerCommon::~SystemInitializerCommon() {}
-llvm::Error
-SystemInitializerCommon::Initialize(const InitializerOptions &options) {
+llvm::Error SystemInitializerCommon::Initialize() {
#if defined(_MSC_VER)
const char *disable_crash_dialog_var = getenv("LLDB_DISABLE_CRASH_DIALOG");
if (disable_crash_dialog_var &&
@@ -65,15 +64,12 @@ SystemInitializerCommon::Initialize(const InitializerOptions &options) {
}
#endif
- // Initialize the reproducer.
- ReproducerMode mode = ReproducerMode::Off;
- if (options.reproducer_capture)
- mode = ReproducerMode::Capture;
- if (options.reproducer_replay)
- mode = ReproducerMode::Replay;
-
- if (auto e = Reproducer::Initialize(mode, FileSpec(options.reproducer_path)))
- return e;
+ // If the reproducer wasn't initialized before, we can safely assume it's
+ // off.
+ if (!Reproducer::Initialized()) {
+ if (auto e = Reproducer::Initialize(ReproducerMode::Off, llvm::None))
+ return e;
+ }
// Initialize the file system.
auto &r = repro::Reproducer::Instance();
OpenPOWER on IntegriCloud