Add a helper function to ProcessStructReader to allow one to inquire about the offset of a field

llvm-svn: 258584
This commit is contained in:
Enrico Granata 2016-01-22 23:50:46 +00:00
parent 6025933789
commit 6eeb5e70e7
1 changed files with 9 additions and 0 deletions

View File

@ -94,6 +94,15 @@ namespace lldb_private {
return fail_value;
return (RetType)(m_data.GetMaxU64(&offset, size));
}
size_t
GetOffsetOf(ConstString name, size_t fail_value = SIZE_MAX)
{
auto iter = m_fields.find(name), end = m_fields.end();
if (iter == end)
return fail_value;
return iter->second.offset;
}
};
}