From 15eacd741faa5ec75ef55d82db3486cbaf91f46f Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 3 Dec 2018 17:28:29 +0000 Subject: [Reproducers] Change how reproducers are initialized. This patch changes the way the reproducer is initialized. Rather than making changes at run time we now do everything at initialization time. To make this happen we had to introduce initializer options and their SB variant. This allows us to tell the initializer that we're running in reproducer capture/replay mode. Because of this change we also had to alter our testing strategy. We cannot reinitialize LLDB when using the dotest infrastructure. Instead we use lit and invoke two instances of the driver. Another consequence is that we can no longer enable capture or replay through commands. This was bound to go away form the beginning, but I had something in mind where you could enable/disable specific providers. However this seems like it adds very little value right now so the corresponding commands were removed. Finally this change also means you now have to control this through the driver, for which I replaced --reproducer with --capture and --replay to differentiate between the two modes. Differential revision: https://reviews.llvm.org/D55038 llvm-svn: 348152 --- lldb/scripts/interface/SBDebugger.i | 6 +++--- lldb/scripts/interface/SBInitializerOptions.i | 24 ++++++++++++++++++++++++ lldb/scripts/lldb.swig | 1 + 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 lldb/scripts/interface/SBInitializerOptions.i (limited to 'lldb/scripts') diff --git a/lldb/scripts/interface/SBDebugger.i b/lldb/scripts/interface/SBDebugger.i index 18796e80e55..fde3d7b6b88 100644 --- a/lldb/scripts/interface/SBDebugger.i +++ b/lldb/scripts/interface/SBDebugger.i @@ -123,6 +123,9 @@ public: static void Initialize(); + static void + Initialize(lldb::SBInitializerOptions& options); + static void Terminate(); @@ -376,9 +379,6 @@ public: const char * GetReproducerPath() const; - lldb::SBError - ReplayReproducer (const char *path); - lldb::ScriptLanguage GetScriptLanguage() const; diff --git a/lldb/scripts/interface/SBInitializerOptions.i b/lldb/scripts/interface/SBInitializerOptions.i new file mode 100644 index 00000000000..9478642ebd6 --- /dev/null +++ b/lldb/scripts/interface/SBInitializerOptions.i @@ -0,0 +1,24 @@ +//===-- SWIG Interface for SBInitializerOptions -----------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +namespace lldb { + +class SBInitializerOptions +{ +public: + SBInitializerOptions (); + SBInitializerOptions (const lldb::SBInitializerOptions &rhs); + ~SBInitializerOptions(); + + void SetCaptureReproducer(bool b); + void SetReplayReproducer(bool b); + void SetReproducerPath(const char* path); +}; + +} // namespace lldb diff --git a/lldb/scripts/lldb.swig b/lldb/scripts/lldb.swig index e920718d3e8..e8553d075d4 100644 --- a/lldb/scripts/lldb.swig +++ b/lldb/scripts/lldb.swig @@ -187,6 +187,7 @@ import six %include "./interface/SBFrame.i" %include "./interface/SBFunction.i" %include "./interface/SBHostOS.i" +%include "./interface/SBInitializerOptions.i" %include "./interface/SBInstruction.i" %include "./interface/SBInstructionList.i" %include "./interface/SBLanguageRuntime.i" -- cgit v1.2.3