summaryrefslogtreecommitdiffstats
path: root/lldb/source/Initialization
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
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')
-rw-r--r--lldb/source/Initialization/SystemInitializerCommon.cpp18
-rw-r--r--lldb/source/Initialization/SystemLifetimeManager.cpp4
2 files changed, 9 insertions, 13 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();
diff --git a/lldb/source/Initialization/SystemLifetimeManager.cpp b/lldb/source/Initialization/SystemLifetimeManager.cpp
index 97e696bb590..97f60489f04 100644
--- a/lldb/source/Initialization/SystemLifetimeManager.cpp
+++ b/lldb/source/Initialization/SystemLifetimeManager.cpp
@@ -25,7 +25,7 @@ SystemLifetimeManager::~SystemLifetimeManager() {
llvm::Error SystemLifetimeManager::Initialize(
std::unique_ptr<SystemInitializer> initializer,
- const InitializerOptions &options, LoadPluginCallbackType plugin_callback) {
+ LoadPluginCallbackType plugin_callback) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (!m_initialized) {
assert(!m_initializer && "Attempting to call "
@@ -34,7 +34,7 @@ llvm::Error SystemLifetimeManager::Initialize(
m_initialized = true;
m_initializer = std::move(initializer);
- if (auto e = m_initializer->Initialize(options))
+ if (auto e = m_initializer->Initialize())
return e;
Debugger::Initialize(plugin_callback);
OpenPOWER on IntegriCloud