diff options
author | emaste <emaste@FreeBSD.org> | 2014-11-25 21:00:58 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-11-25 21:00:58 +0000 |
commit | 01ee1789d6aa7294e5966a97f8d29387f6f81699 (patch) | |
tree | c94307da318be46e5aeea1a325c1e91749506e4f /source/Target/ThreadPlanCallUserExpression.cpp | |
parent | 788502c6f6261e2d84ef85d1052b41a6c5be31b3 (diff) | |
download | FreeBSD-src-01ee1789d6aa7294e5966a97f8d29387f6f81699.zip FreeBSD-src-01ee1789d6aa7294e5966a97f8d29387f6f81699.tar.gz |
Import LLDB as of upstream SVN r216948 (git 50f7fe44)
This corresponds with the branchpoint for the 3.5 release.
A number of files not required for the FreeBSD build have been removed.
Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Target/ThreadPlanCallUserExpression.cpp')
-rw-r--r-- | source/Target/ThreadPlanCallUserExpression.cpp | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/source/Target/ThreadPlanCallUserExpression.cpp b/source/Target/ThreadPlanCallUserExpression.cpp index 827de3e..90b8cf8 100644 --- a/source/Target/ThreadPlanCallUserExpression.cpp +++ b/source/Target/ThreadPlanCallUserExpression.cpp @@ -12,7 +12,7 @@ // C Includes // C++ Includes // Other libraries and framework includes -#include "llvm/Support/MachO.h" + // Project includes #include "lldb/lldb-private-log.h" #include "lldb/Breakpoint/Breakpoint.h" @@ -21,6 +21,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Stream.h" #include "lldb/Expression/ClangUserExpression.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Target/LanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" @@ -56,7 +57,54 @@ ThreadPlanCallUserExpression::~ThreadPlanCallUserExpression () void ThreadPlanCallUserExpression::GetDescription (Stream *s, lldb::DescriptionLevel level) { - ThreadPlanCallFunction::GetDescription (s, level); + if (level == eDescriptionLevelBrief) + s->Printf("User Expression thread plan"); + else + ThreadPlanCallFunction::GetDescription (s, level); +} + +void +ThreadPlanCallUserExpression::WillPop () +{ + ThreadPlanCallFunction::WillPop(); + if (m_user_expression_sp) + m_user_expression_sp.reset(); +} + +bool +ThreadPlanCallUserExpression::MischiefManaged () +{ + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + + if (IsPlanComplete()) + { + if (log) + log->Printf("ThreadPlanCallFunction(%p): Completed call function plan.", + static_cast<void*>(this)); + + if (m_manage_materialization && PlanSucceeded() && m_user_expression_sp) + { + lldb::addr_t function_stack_top; + lldb::addr_t function_stack_bottom; + lldb::addr_t function_stack_pointer = GetFunctionStackPointer(); + + function_stack_bottom = function_stack_pointer - HostInfo::GetPageSize(); + function_stack_top = function_stack_pointer; + + StreamString error_stream; + + ExecutionContext exe_ctx(GetThread()); + + m_user_expression_sp->FinalizeJITExecution(error_stream, exe_ctx, m_result_var_sp, function_stack_bottom, function_stack_top); + } + + ThreadPlan::MischiefManaged (); + return true; + } + else + { + return false; + } } StopInfoSP |