Made sure that ValueObjectVariable actually

updates itself before it tries to set its own
data.  Otherwise it has no idea where to put the
data value.

<rdar://problem/15846476>

llvm-svn: 199533
This commit is contained in:
Sean Callanan 2014-01-18 01:13:50 +00:00
parent 661f35b0c5
commit 6826d22784
1 changed files with 12 additions and 0 deletions

View File

@ -328,6 +328,12 @@ ValueObjectVariable::GetLocationAsCString ()
bool bool
ValueObjectVariable::SetValueFromCString (const char *value_str, Error& error) ValueObjectVariable::SetValueFromCString (const char *value_str, Error& error)
{ {
if (!UpdateValueIfNeeded())
{
error.SetErrorString("unable to update value before writing");
return false;
}
if (m_resolved_value.GetContextType() == Value::eContextTypeRegisterInfo) if (m_resolved_value.GetContextType() == Value::eContextTypeRegisterInfo)
{ {
RegisterInfo *reg_info = m_resolved_value.GetRegisterInfo(); RegisterInfo *reg_info = m_resolved_value.GetRegisterInfo();
@ -360,6 +366,12 @@ ValueObjectVariable::SetValueFromCString (const char *value_str, Error& error)
bool bool
ValueObjectVariable::SetData (DataExtractor &data, Error &error) ValueObjectVariable::SetData (DataExtractor &data, Error &error)
{ {
if (!UpdateValueIfNeeded())
{
error.SetErrorString("unable to update value before writing");
return false;
}
if (m_resolved_value.GetContextType() == Value::eContextTypeRegisterInfo) if (m_resolved_value.GetContextType() == Value::eContextTypeRegisterInfo)
{ {
RegisterInfo *reg_info = m_resolved_value.GetRegisterInfo(); RegisterInfo *reg_info = m_resolved_value.GetRegisterInfo();