本文整理汇总了C++中DWARFDebugArangeSet::GetCompileUnitDIEOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFDebugArangeSet::GetCompileUnitDIEOffset方法的具体用法?C++ DWARFDebugArangeSet::GetCompileUnitDIEOffset怎么用?C++ DWARFDebugArangeSet::GetCompileUnitDIEOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFDebugArangeSet
的用法示例。
在下文中一共展示了DWARFDebugArangeSet::GetCompileUnitDIEOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
//----------------------------------------------------------------------
// Extract
//----------------------------------------------------------------------
bool
DWARFDebugAranges::Extract(const DataExtractor &debug_aranges_data)
{
if (debug_aranges_data.ValidOffset(0))
{
uint32_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;
}
示例2: operator
void operator() (const DWARFDebugArangeSet& set)
{
const DWARFDebugArangeSet::Descriptor* arange_desc_ptr;
DWARFDebugAranges::Range range;
range.offset = set.GetCompileUnitDIEOffset();
for (uint32_t i=0; (arange_desc_ptr = set.GetDescriptor(i)) != NULL; ++i)
{
range.lo_pc = arange_desc_ptr->address;
range.hi_pc = arange_desc_ptr->address + arange_desc_ptr->length;
// Insert each item in increasing address order so binary searching
// can later be done!
DWARFDebugAranges::RangeColl::iterator insert_pos = lower_bound(range_collection.begin(), range_collection.end(), range, RangeLessThan);
range_collection.insert(insert_pos, range);
}
}