mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 04:17:17 +08:00
<rdar://problem/12437442>
Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar* If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was no trivial way for us to change the SP inside an SBValue on the fly This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM) As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases) llvm-svn: 166426
This commit is contained in:
@@ -549,12 +549,12 @@ SBFrame::GetValueForVariablePath (const char *var_path, DynamicValueType use_dyn
|
||||
{
|
||||
VariableSP var_sp;
|
||||
Error error;
|
||||
ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
|
||||
use_dynamic,
|
||||
ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
|
||||
eNoDynamicValues,
|
||||
StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
|
||||
var_sp,
|
||||
error));
|
||||
sb_value.SetSP(value_sp);
|
||||
sb_value.SetSP(value_sp, use_dynamic);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -619,8 +619,8 @@ SBFrame::FindVariable (const char *name, lldb::DynamicValueType use_dynamic)
|
||||
|
||||
if (var_sp)
|
||||
{
|
||||
value_sp = frame->GetValueObjectForFrameVariable(var_sp, use_dynamic);
|
||||
sb_value.SetSP(value_sp);
|
||||
value_sp = frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
|
||||
sb_value.SetSP(value_sp, use_dynamic);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -697,8 +697,8 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
|
||||
variable_sp->GetScope() == value_type &&
|
||||
variable_sp->GetName() == const_name)
|
||||
{
|
||||
value_sp = frame->GetValueObjectForFrameVariable (variable_sp, use_dynamic);
|
||||
sb_value.SetSP (value_sp);
|
||||
value_sp = frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues);
|
||||
sb_value.SetSP (value_sp, use_dynamic);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -757,7 +757,7 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
|
||||
if (expr_var_sp)
|
||||
{
|
||||
value_sp = expr_var_sp->GetValueObject();
|
||||
sb_value.SetSP (value_sp);
|
||||
sb_value.SetSP (value_sp, use_dynamic);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -939,7 +939,10 @@ SBFrame::GetVariables (bool arguments,
|
||||
if (in_scope_only && !variable_sp->IsInScope(frame))
|
||||
continue;
|
||||
|
||||
value_list.Append(frame->GetValueObjectForFrameVariable (variable_sp, use_dynamic));
|
||||
ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues));
|
||||
SBValue value_sb;
|
||||
value_sb.SetSP(valobj_sp,use_dynamic);
|
||||
value_list.Append(value_sb);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1102,7 +1105,7 @@ SBFrame::EvaluateExpression (const char *expr, const SBExpressionOptions &option
|
||||
frame,
|
||||
expr_value_sp,
|
||||
options.ref());
|
||||
expr_result.SetSP(expr_value_sp);
|
||||
expr_result.SetSP(expr_value_sp,options.GetFetchDynamicValue());
|
||||
#ifdef LLDB_CONFIGURATION_DEBUG
|
||||
Host::SetCrashDescription (NULL);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user