summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index dfb4d5963d7..fb5fc4c9871 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1070,6 +1070,10 @@ CommandInterpreter::PreprocessCommand (std::string &command)
std::string expr_str (command, expr_content_start, end_backtick - expr_content_start);
Target *target = m_exe_ctx.GetTargetPtr();
+ // Get a dummy target to allow for calculator mode while processing backticks.
+ // This also helps break the infinite loop caused when target is null.
+ if (!target)
+ target = Host::GetDummyTarget(GetDebugger()).get();
if (target)
{
const bool unwind_on_error = true;
OpenPOWER on IntegriCloud