summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 64106eda2d0..37659f5e697 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -252,11 +252,29 @@ CommandObjectExpression::EvaluateExpression (const char *expr, bool bare, Stream
ClangExpressionVariableList expr_local_vars;
bool success;
+ bool canInterpret = false;
if (m_options.use_ir)
- success = (clang_expr.ConvertIRToDWARF (expr_local_vars, dwarf_opcodes) == 0);
+ {
+ canInterpret = clang_expr.ConvertIRToDWARF (expr_local_vars, dwarf_opcodes);
+
+ if (canInterpret)
+ {
+ if (log)
+ log->Printf("Code can be interpreted.");
+ success = true;
+ }
+ else
+ {
+ if (log)
+ log->Printf("Code cannot be interpreted and must be run in the target.");
+ success = clang_expr.PrepareIRForTarget (expr_local_vars);
+ }
+ }
else
+ {
success = (clang_expr.ConvertExpressionToDWARF (expr_local_vars, dwarf_opcodes) == 0);
+ }
if (!success)
{
OpenPOWER on IntegriCloud