diff options
author | Ryan Brown <ribrdb@google.com> | 2015-11-02 19:30:40 +0000 |
---|---|---|
committer | Ryan Brown <ribrdb@google.com> | 2015-11-02 19:30:40 +0000 |
commit | 998c8a1c1c1cd0fa1cb1e1368abc52ba23caa987 (patch) | |
tree | e24424d6e8529b32b60550ecc4794f70ce8f6912 /lldb/source/API/SBFrame.cpp | |
parent | 7d564544eb73710e1a5769b9832890f620d0997d (diff) | |
download | bcm5719-llvm-998c8a1c1c1cd0fa1cb1e1368abc52ba23caa987.tar.gz bcm5719-llvm-998c8a1c1c1cd0fa1cb1e1368abc52ba23caa987.zip |
Create an expression parser for Go.
The Go interpreter doesn't JIT or use LLVM, so this also
moves all the JIT related code from UserExpression to a new class LLVMUserExpression.
Differential Revision: http://reviews.llvm.org/D13073
Fix merge
llvm-svn: 251820
Diffstat (limited to 'lldb/source/API/SBFrame.cpp')
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 02664ff88c9..02a215beb07 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -1389,6 +1389,10 @@ SBFrame::EvaluateExpression (const char *expr) lldb::DynamicValueType fetch_dynamic_value = frame->CalculateTarget()->GetPreferDynamicValue(); options.SetFetchDynamicValue (fetch_dynamic_value); options.SetUnwindOnError (true); + if (target->GetLanguage() != eLanguageTypeUnknown) + options.SetLanguage(target->GetLanguage()); + else + options.SetLanguage(frame->GetLanguage()); return EvaluateExpression (expr, options); } return result; @@ -1400,6 +1404,13 @@ SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dyna SBExpressionOptions options; options.SetFetchDynamicValue (fetch_dynamic_value); options.SetUnwindOnError (true); + ExecutionContext exe_ctx(m_opaque_sp.get()); + StackFrame *frame = exe_ctx.GetFramePtr(); + Target *target = exe_ctx.GetTargetPtr(); + if (target && target->GetLanguage() != eLanguageTypeUnknown) + options.SetLanguage(target->GetLanguage()); + else if (frame) + options.SetLanguage(frame->GetLanguage()); return EvaluateExpression (expr, options); } @@ -1407,8 +1418,15 @@ SBValue SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error) { SBExpressionOptions options; + ExecutionContext exe_ctx(m_opaque_sp.get()); options.SetFetchDynamicValue (fetch_dynamic_value); options.SetUnwindOnError (unwind_on_error); + StackFrame *frame = exe_ctx.GetFramePtr(); + Target *target = exe_ctx.GetTargetPtr(); + if (target && target->GetLanguage() != eLanguageTypeUnknown) + options.SetLanguage(target->GetLanguage()); + else if (frame) + options.SetLanguage(frame->GetLanguage()); return EvaluateExpression (expr, options); } |