diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-15 01:05:40 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-15 01:05:40 +0000 |
commit | df14b94243e9e8ade2747e6adb8a3d9d2cfa71ae (patch) | |
tree | 5b1e569a4ef2229791e3cbe407a830efbc9ce2bd | |
parent | bfb75348e29298beb9e62cf0e88a67f754b4ad58 (diff) | |
download | bcm5719-llvm-df14b94243e9e8ade2747e6adb8a3d9d2cfa71ae.tar.gz bcm5719-llvm-df14b94243e9e8ade2747e6adb8a3d9d2cfa71ae.zip |
[reproducer] Post-commit cleanup
After committing the initial reproducer feature I noticed a few small
issues which warranted addressing here. It fixes incorrect documentation
in the command object and extract some duplicated code into the debugger
object.
llvm-svn: 346919
-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); |