summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-01-22 23:50:46 +0000
committerEnrico Granata <egranata@apple.com>2016-01-22 23:50:46 +0000
commit6eeb5e70e7dff27151452894b966981b58bcd81e (patch)
treeac7410d8c856145faaa60bfdfb20762141256cfe /lldb
parent602593378936c969e2dc7e7924f744943d129ba6 (diff)
downloadbcm5719-llvm-6eeb5e70e7dff27151452894b966981b58bcd81e.tar.gz
bcm5719-llvm-6eeb5e70e7dff27151452894b966981b58bcd81e.zip
Add a helper function to ProcessStructReader to allow one to inquire about the offset of a field
llvm-svn: 258584
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Utility/ProcessStructReader.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/include/lldb/Utility/ProcessStructReader.h b/lldb/include/lldb/Utility/ProcessStructReader.h
index 80f90feb87a..bbb497cd51c 100644
--- a/lldb/include/lldb/Utility/ProcessStructReader.h
+++ b/lldb/include/lldb/Utility/ProcessStructReader.h
@@ -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;
+ }
};
}
OpenPOWER on IntegriCloud