diff options
-rw-r--r-- | lldb/include/lldb/Core/Debugger.h | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectReproducer.cpp | 13 | ||||
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h index 0419bdefac1..52750180d01 100644 --- a/lldb/include/lldb/Core/Debugger.h +++ b/lldb/include/lldb/Core/Debugger.h @@ -266,6 +266,8 @@ public: void SetReproducerPath(llvm::StringRef p); void SetReproducerPath(const char *) = delete; + llvm::Error SetReproducerCapture(bool b); + bool GetUseExternalEditor() const; bool SetUseExternalEditor(bool use_external_editor_p); diff --git a/lldb/source/Commands/CommandObjectReproducer.cpp b/lldb/source/Commands/CommandObjectReproducer.cpp index e69a6308892..a1fdb4a1fcd 100644 --- a/lldb/source/Commands/CommandObjectReproducer.cpp +++ b/lldb/source/Commands/CommandObjectReproducer.cpp @@ -11,6 +11,7 @@ #include "lldb/Utility/Reproducer.h" +#include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupBoolean.h" @@ -40,8 +41,7 @@ protected: return false; } - auto &r = repro::Reproducer::Instance(); - if (auto e = r.SetGenerateReproducer(true)) { + if (auto e = m_interpreter.GetDebugger().SetReproducerCapture(true)) { AppendErrorToResult(std::move(e), result); return false; } @@ -68,8 +68,7 @@ protected: return false; } - auto &r = repro::Reproducer::Instance(); - if (auto e = r.SetGenerateReproducer(false)) { + if (auto e = m_interpreter.GetDebugger().SetReproducerCapture(false)) { AppendErrorToResult(std::move(e), result); return false; } @@ -114,10 +113,8 @@ protected: class CommandObjectReproducerReplay : public CommandObjectParsed { public: CommandObjectReproducerReplay(CommandInterpreter &interpreter) - : CommandObjectParsed(interpreter, "reproducer capture", - "Enable or disable gathering of information needed " - "to generate a reproducer.", - nullptr) { + : CommandObjectParsed(interpreter, "reproducer replay", + "Replay a reproducer.", nullptr) { CommandArgumentEntry arg1; CommandArgumentData path_arg; diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 1494783bc8f..c8af3284162 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -424,6 +424,13 @@ void Debugger::SetReproducerPath(llvm::StringRef p) { llvm::consumeError(std::move(e)); } +llvm::Error Debugger::SetReproducerCapture(bool b) { + auto &r = repro::Reproducer::Instance(); + if (auto e = r.SetGenerateReproducer(false)) + return e; + return llvm::Error::success(); +} + const FormatEntity::Entry *Debugger::GetThreadFormat() const { const uint32_t idx = ePropertyThreadFormat; return m_collection_sp->GetPropertyAtIndexAsFormatEntity(nullptr, idx); |