本文整理汇总了C++中DWARFDataExtractor::ValidOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFDataExtractor::ValidOffset方法的具体用法?C++ DWARFDataExtractor::ValidOffset怎么用?C++ DWARFDataExtractor::ValidOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFDataExtractor
的用法示例。
在下文中一共展示了DWARFDataExtractor::ValidOffset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clear
bool
DWARFCompileUnit::Extract(const DWARFDataExtractor &debug_info, lldb::offset_t *offset_ptr)
{
Clear();
m_offset = *offset_ptr;
if (debug_info.ValidOffset(*offset_ptr))
{
dw_offset_t abbr_offset;
const DWARFDebugAbbrev *abbr = m_dwarf2Data->DebugAbbrev();
m_length = debug_info.GetDWARFInitialLength(offset_ptr);
m_is_dwarf64 = debug_info.IsDWARF64();
m_version = debug_info.GetU16(offset_ptr);
abbr_offset = debug_info.GetDWARFOffset(offset_ptr);
m_addr_size = debug_info.GetU8 (offset_ptr);
bool length_OK = debug_info.ValidOffset(GetNextCompileUnitOffset()-1);
bool version_OK = SymbolFileDWARF::SupportedVersion(m_version);
bool abbr_offset_OK = m_dwarf2Data->get_debug_abbrev_data().ValidOffset(abbr_offset);
bool addr_size_OK = ((m_addr_size == 4) || (m_addr_size == 8));
if (length_OK && version_OK && addr_size_OK && abbr_offset_OK && abbr != NULL)
{
m_abbrevs = abbr->GetAbbreviationDeclarationSet(abbr_offset);
return true;
}
// reset the offset to where we tried to parse from if anything went wrong
*offset_ptr = m_offset;
}
return false;
}
示例2: scoped_timer
bool
DWARFDebugPubnames::Extract(const DWARFDataExtractor& data)
{
Timer scoped_timer (__PRETTY_FUNCTION__,
"DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")",
(uint64_t)data.GetByteSize());
Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES));
if (log)
log->Printf("DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")", (uint64_t)data.GetByteSize());
if (data.ValidOffset(0))
{
lldb::offset_t offset = 0;
DWARFDebugPubnamesSet set;
while (data.ValidOffset(offset))
{
if (set.Extract(data, &offset))
{
m_sets.push_back(set);
offset = set.GetOffsetOfNextEntry();
}
else
break;
}
if (log)
Dump (log);
return true;
}
return false;
}
示例3: while
bool
DWARFAbbreviationDeclaration::Extract(const DWARFDataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code)
{
m_code = code;
m_attributes.clear();
if (m_code)
{
m_tag = data.GetULEB128(offset_ptr);
m_has_children = data.GetU8(offset_ptr);
while (data.ValidOffset(*offset_ptr))
{
dw_attr_t attr = data.GetULEB128(offset_ptr);
dw_form_t form = data.GetULEB128(offset_ptr);
if (attr && form)
m_attributes.push_back(DWARFAttribute(attr, form));
else
break;
}
return m_tag != 0;
}
else
{
m_tag = 0;
m_has_children = 0;
}
return false;
}
示例4: Parse
//----------------------------------------------------------------------
// DWARFDebugAbbrev::Parse()
//----------------------------------------------------------------------
void DWARFDebugAbbrev::Parse(const DWARFDataExtractor &data) {
lldb::offset_t offset = 0;
while (data.ValidOffset(offset)) {
uint32_t initial_cu_offset = offset;
DWARFAbbreviationDeclarationSet abbrevDeclSet;
if (abbrevDeclSet.Extract(data, &offset))
m_abbrevCollMap[initial_cu_offset] = abbrevDeclSet;
else
break;
}
m_prev_abbr_offset_pos = m_abbrevCollMap.end();
}
示例5: Extract
//----------------------------------------------------------------------
// Extract
//----------------------------------------------------------------------
bool DWARFDebugAranges::Extract(const DWARFDataExtractor &debug_aranges_data) {
if (debug_aranges_data.ValidOffset(0)) {
lldb::offset_t offset = 0;
DWARFDebugArangeSet set;
Range range;
while (set.Extract(debug_aranges_data, &offset)) {
const uint32_t num_descriptors = set.NumDescriptors();
if (num_descriptors > 0) {
const dw_offset_t cu_offset = set.GetCompileUnitDIEOffset();
for (uint32_t i = 0; i < num_descriptors; ++i) {
const DWARFDebugArangeSet::Descriptor &descriptor =
set.GetDescriptorRef(i);
m_aranges.Append(RangeToDIE::Entry(descriptor.address,
descriptor.length, cu_offset));
}
}
set.Clear();
}
}
return false;
}