diff options
author | Enrico Granata <egranata@apple.com> | 2015-02-11 02:35:39 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-02-11 02:35:39 +0000 |
commit | 560558eb7c1deee76a1adb941e001e074dba460d (patch) | |
tree | 361a34a9afb6b9516874d4537736cae2b917806a /lldb/source/API | |
parent | 7ad134a7467c97ce9d8ef46fea90267a03c30b30 (diff) | |
download | bcm5719-llvm-560558eb7c1deee76a1adb941e001e074dba460d.tar.gz bcm5719-llvm-560558eb7c1deee76a1adb941e001e074dba460d.zip |
Introduce the notion of "runtime support values"
A runtime support value is a ValueObject whose only purpose is to support some language runtime's operation, but it does not directly provide any user-visible benefit
As such, unless the user is working on the runtime support, it is mostly safe for them not to see such a value when debugging
It is a language runtime's job to check whether a ValueObject is a support value, and that - in conjunction with a target setting - is used by frame variable and target variable
SBFrame::GetVariables gets a new overload with yet another flag to dictate whether to return those support values to the caller - that which defaults to the setting's value
rdar://problem/15539930
llvm-svn: 228791
Diffstat (limited to 'lldb/source/API')
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 25 | ||||
-rw-r--r-- | lldb/source/API/SBValue.cpp | 16 |
2 files changed, 41 insertions, 0 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 325f40fd5b5..da1d32f2e80 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -1080,11 +1080,30 @@ SBFrame::GetVariables (bool arguments, return value_list; } +lldb::SBValueList +SBFrame::GetVariables (bool arguments, + bool locals, + bool statics, + bool in_scope_only, + lldb::DynamicValueType use_dynamic) +{ + ExecutionContext exe_ctx(m_opaque_sp.get()); + Target *target = exe_ctx.GetTargetPtr(); + bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false; + return GetVariables(arguments, + locals, + statics, + in_scope_only, + include_runtime_support_values, + use_dynamic); +} + SBValueList SBFrame::GetVariables (bool arguments, bool locals, bool statics, bool in_scope_only, + bool include_runtime_support_values, lldb::DynamicValueType use_dynamic) { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); @@ -1147,6 +1166,12 @@ SBFrame::GetVariables (bool arguments, continue; ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues)); + + if (false == include_runtime_support_values && + valobj_sp && + true == valobj_sp->IsRuntimeSupportValue()) + continue; + SBValue value_sb; value_sb.SetSP(valobj_sp,use_dynamic); value_list.Append(value_sb); diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index edecb93944a..e383f4ca919 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -1244,6 +1244,22 @@ SBValue::MightHaveChildren () return has_children; } +bool +SBValue::IsRuntimeSupportValue () +{ + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + bool is_support = false; + ValueLocker locker; + lldb::ValueObjectSP value_sp(GetSP(locker)); + if (value_sp) + is_support = value_sp->IsRuntimeSupportValue(); + + if (log) + log->Printf ("SBValue(%p)::IsRuntimeSupportValue() => %i", + static_cast<void*>(value_sp.get()), is_support); + return is_support; +} + uint32_t SBValue::GetNumChildren () { |