forked from OSchip/llvm-project
Fixed two problems when reading constant/register
variables in the ValueObject code: - Report an error if the variable does not have a valid address. - Return the contents of the data to GetData(), even if the value is constant. <rdar://problem/13690855> llvm-svn: 179876
This commit is contained in:
parent
e8f9bfdb71
commit
ed185ab5c7
|
@ -1007,7 +1007,17 @@ ValueObject::GetData (DataExtractor& data)
|
|||
ExecutionContext exe_ctx (GetExecutionContextRef());
|
||||
Error error = m_value.GetValueAsData(&exe_ctx, GetClangAST(), data, 0, GetModule().get());
|
||||
if (error.Fail())
|
||||
{
|
||||
if (m_data.GetByteSize())
|
||||
{
|
||||
data = m_data;
|
||||
return data.GetByteSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
data.SetAddressByteSize(m_data.GetAddressByteSize());
|
||||
data.SetByteOrder(m_data.GetByteOrder());
|
||||
return data.GetByteSize();
|
||||
|
@ -3832,6 +3842,13 @@ ValueObject::AddressOf (Error &error)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StreamString expr_path_strm;
|
||||
GetExpressionPath(expr_path_strm, true);
|
||||
error.SetErrorStringWithFormat("'%s' doesn't have a valid address", expr_path_strm.GetString().c_str());
|
||||
}
|
||||
|
||||
return m_addr_of_valobj_sp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue