diff options
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index fa686f6d459..dc618d2c65c 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -455,7 +455,9 @@ SBFrame::GetFrameID () const { uint32_t frame_idx = UINT32_MAX; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); if (frame) frame_idx = frame->GetFrameIndex (); @@ -470,7 +472,9 @@ SBFrame::GetFrameID () const lldb::addr_t SBFrame::GetCFA () const { - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); if (frame) return frame->GetStackID().GetCallFrameAddress(); @@ -689,7 +693,9 @@ lldb::SBValue SBFrame::GetValueForVariablePath (const char *var_path) { SBValue sb_value; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -754,7 +760,9 @@ SBValue SBFrame::FindVariable (const char *name) { SBValue value; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -844,7 +852,9 @@ SBValue SBFrame::FindValue (const char *name, ValueType value_type) { SBValue value; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -1027,7 +1037,9 @@ SBFrame::GetThread () const { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + ThreadSP thread_sp (exe_ctx.GetThreadSP()); SBThread sb_thread (thread_sp); @@ -1091,7 +1103,9 @@ SBFrame::GetVariables (bool arguments, bool in_scope_only) { SBValueList value_list; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -1119,7 +1133,9 @@ SBFrame::GetVariables (bool arguments, bool in_scope_only, lldb::DynamicValueType use_dynamic) { - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + Target *target = exe_ctx.GetTargetPtr(); const bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false; SBVariablesOptions options; @@ -1403,7 +1419,9 @@ SBValue SBFrame::EvaluateExpression (const char *expr) { SBValue result; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -1429,7 +1447,9 @@ SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dyna options.SetFetchDynamicValue (fetch_dynamic_value); options.SetUnwindOnError (true); options.SetIgnoreBreakpoints (true); - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (target && target->GetLanguage() != eLanguageTypeUnknown) @@ -1443,7 +1463,9 @@ SBValue SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error) { SBExpressionOptions options; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + options.SetFetchDynamicValue (fetch_dynamic_value); options.SetUnwindOnError (unwind_on_error); options.SetIgnoreBreakpoints (true); @@ -1549,7 +1571,9 @@ bool SBFrame::IsInlined() const { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = nullptr; Target *target = exe_ctx.GetTargetPtr(); Process *process = exe_ctx.GetProcessPtr(); @@ -1593,7 +1617,9 @@ SBFrame::GetFunctionName() const { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *name = nullptr; - ExecutionContext exe_ctx(m_opaque_sp.get()); + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = nullptr; Target *target = exe_ctx.GetTargetPtr(); Process *process = exe_ctx.GetProcessPtr(); @@ -1649,7 +1675,10 @@ SBFrame::GetDisplayFunctionName() { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); const char *name = nullptr; - ExecutionContext exe_ctx(m_opaque_sp.get()); + + std::unique_lock<std::recursive_mutex> lock; + ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = nullptr; Target *target = exe_ctx.GetTargetPtr(); Process *process = exe_ctx.GetProcessPtr(); |