本文整理汇总了C++中Stream::GetAddressByteSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::GetAddressByteSize方法的具体用法?C++ Stream::GetAddressByteSize怎么用?C++ Stream::GetAddressByteSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stream
的用法示例。
在下文中一共展示了Stream::GetAddressByteSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr)
{
uint32_t addr_size = s.GetAddressByteSize();
bool verbose = s.GetVerbose();
dw_addr_t base_addr = cu_base_addr;
while (debug_ranges_data.ValidOffsetForDataOfSize(*offset_ptr, 2 * addr_size))
{
dw_addr_t begin = debug_ranges_data.GetMaxU64(offset_ptr, addr_size);
dw_addr_t end = debug_ranges_data.GetMaxU64(offset_ptr, addr_size);
// Extend 4 byte addresses that consits of 32 bits of 1's to be 64 bits
// of ones
if (begin == 0xFFFFFFFFull && addr_size == 4)
begin = DW_INVALID_ADDRESS;
s.Indent();
if (verbose)
{
s.AddressRange(begin, end, sizeof (dw_addr_t), " offsets = ");
}
if (begin == 0 && end == 0)
{
s.PutCString(" End");
break;
}
else if (begin == DW_INVALID_ADDRESS)
{
// A base address selection entry
base_addr = end;
s.Address(base_addr, sizeof (dw_addr_t), " Base address = ");
}
else
{
// Convert from offset to an address
dw_addr_t begin_addr = begin + base_addr;
dw_addr_t end_addr = end + base_addr;
s.AddressRange(begin_addr, end_addr, sizeof (dw_addr_t), verbose ? " ==> addrs = " : NULL);
}
}
}