Added a function to the Host that gets a dummy target
for it, so that people who want to use LLDB as a
calculator can run simple expressions without needing
a target or process.
llvm-svn: 143147
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 3ec585e..5134b28 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -283,6 +283,10 @@
)
{
Target *target = m_exe_ctx.GetTargetPtr();
+
+ if (!target)
+ target = Host::GetDummyTarget(m_interpreter.GetDebugger()).get();
+
if (target)
{
lldb::ValueObjectSP result_valobj_sp;