summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r--lldb/source/Core/ValueObject.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 409f3d6b13f..73cd1339433 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1695,18 +1695,28 @@ bool ValueObject::IsPossibleDynamicType() {
bool ValueObject::IsRuntimeSupportValue() {
Process *process(GetProcessSP().get());
- if (process) {
- LanguageRuntime *runtime =
- process->GetLanguageRuntime(GetObjectRuntimeLanguage());
- if (!runtime)
- runtime = ObjCLanguageRuntime::Get(*process);
- if (runtime)
- return runtime->IsRuntimeSupportValue(*this);
- // If there is no language runtime, trust the compiler to mark all
- // runtime support variables as artificial.
- return GetVariable() && GetVariable()->IsArtificial();
+ if (!process)
+ return false;
+
+ // We trust the the compiler did the right thing and marked runtime support
+ // values as artificial.
+ if (!GetVariable() || !GetVariable()->IsArtificial())
+ return false;
+
+ LanguageType lang = eLanguageTypeUnknown;
+ if (auto *sym_ctx_scope = GetSymbolContextScope()) {
+ if (auto *func = sym_ctx_scope->CalculateSymbolContextFunction())
+ lang = func->GetLanguage();
+ else if (auto *comp_unit =
+ sym_ctx_scope->CalculateSymbolContextCompileUnit())
+ lang = comp_unit->GetLanguage();
}
- return false;
+
+ if (auto *runtime = process->GetLanguageRuntime(lang))
+ if (runtime->IsWhitelistedRuntimeValue(GetName()))
+ return false;
+
+ return true;
}
bool ValueObject::IsNilReference() {
OpenPOWER on IntegriCloud