Get a dummy target to allow for calculator mode while processing backticks.
This also helps break the infinite loop caused when target is null.
So that we can have:
$ /Volumes/data/lldb/svn/trunk/build/Debug/lldb
(lldb) itob `0x123 - 0x321` 32 v
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0]
(lldb)
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143260 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index dfb4d59..fb5fc4c 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -1070,6 +1070,10 @@
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;