aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectCommands.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-04-27 06:19:42 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-04-27 06:19:42 +0000
commit57179860a0547afc482171ef304976c7761a3fd8 (patch)
treed62c85bdab803d12e4f0bc7310a441fe70db01e1 /lldb/source/Commands/CommandObjectCommands.cpp
parent40dfc3920e022beb920b7236bfdcce0e037d8e0e (diff)
downloadllvm-57179860a0547afc482171ef304976c7761a3fd8.zip
llvm-57179860a0547afc482171ef304976c7761a3fd8.tar.gz
llvm-57179860a0547afc482171ef304976c7761a3fd8.tar.bz2
[CommandObject] Use GetDebugger() helper method (NFC)
In r359354 a GetDebugger() method was added to the CommandObject class, so that we didn't have to go through the command interpreter to obtain the script interpreter. This patch simplifies other call sites where m_interpreter.GetDebugger() was used, and replaces them with a shorter call to the new method. llvm-svn: 359373
Diffstat (limited to 'lldb/source/Commands/CommandObjectCommands.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 45427753..cd0c2f1 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -985,11 +985,8 @@ protected:
llvm::StringRef bytes_strref(lines[i]);
Status error = AppendRegexSubstitution(bytes_strref, check_only);
if (error.Fail()) {
- if (!m_interpreter.GetDebugger()
- .GetCommandInterpreter()
- .GetBatchCommandMode()) {
- StreamSP out_stream =
- m_interpreter.GetDebugger().GetAsyncOutputStream();
+ if (!GetDebugger().GetCommandInterpreter().GetBatchCommandMode()) {
+ StreamSP out_stream = GetDebugger().GetAsyncOutputStream();
out_stream->Printf("error: %s\n", error.AsCString());
}
}
@@ -1018,7 +1015,7 @@ protected:
true);
if (argc == 1) {
- Debugger &debugger = m_interpreter.GetDebugger();
+ Debugger &debugger = GetDebugger();
bool color_prompt = debugger.GetUseColor();
const bool multiple_lines = true; // Get multiple lines
IOHandlerSP io_handler_sp(new IOHandlerEditline(
@@ -1462,8 +1459,7 @@ protected:
};
bool DoExecute(Args &command, CommandReturnObject &result) override {
- if (m_interpreter.GetDebugger().GetScriptLanguage() !=
- lldb::eScriptLanguagePython) {
+ if (GetDebugger().GetScriptLanguage() != lldb::eScriptLanguagePython) {
result.AppendError("only scripting language supported for module "
"importing is currently Python");
result.SetStatus(eReturnStatusFailed);
@@ -1676,8 +1672,7 @@ protected:
protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
- if (m_interpreter.GetDebugger().GetScriptLanguage() !=
- lldb::eScriptLanguagePython) {
+ if (GetDebugger().GetScriptLanguage() != lldb::eScriptLanguagePython) {
result.AppendError("only scripting language supported for scripted "
"commands is currently Python");
result.SetStatus(eReturnStatusFailed);