本文整理汇总了C++中DWARFDataExtractor::Skip_LEB128方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFDataExtractor::Skip_LEB128方法的具体用法?C++ DWARFDataExtractor::Skip_LEB128怎么用?C++ DWARFDataExtractor::Skip_LEB128使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFDataExtractor
的用法示例。
在下文中一共展示了DWARFDataExtractor::Skip_LEB128方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkipValue
bool
DWARFFormValue::SkipValue(dw_form_t form, const DWARFDataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu)
{
uint8_t ref_addr_size;
switch (form)
{
// Blocks if inlined data that have a length field and the data bytes
// inlined in the .debug_info
case DW_FORM_exprloc:
case DW_FORM_block: { dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr); *offset_ptr += size; } return true;
case DW_FORM_block1: { dw_uleb128_t size = debug_info_data.GetU8(offset_ptr); *offset_ptr += size; } return true;
case DW_FORM_block2: { dw_uleb128_t size = debug_info_data.GetU16(offset_ptr); *offset_ptr += size; } return true;
case DW_FORM_block4: { dw_uleb128_t size = debug_info_data.GetU32(offset_ptr); *offset_ptr += size; } return true;
// Inlined NULL terminated C-strings
case DW_FORM_string:
debug_info_data.GetCStr(offset_ptr);
return true;
// Compile unit address sized values
case DW_FORM_addr:
*offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu);
return true;
case DW_FORM_ref_addr:
ref_addr_size = 4;
if (cu) {
if (cu->GetVersion() <= 2)
ref_addr_size = cu->GetAddressByteSize();
else
ref_addr_size = cu->IsDWARF64() ? 8 : 4;
}
*offset_ptr += ref_addr_size;
return true;
// 0 bytes values (implied from DW_FORM)
case DW_FORM_flag_present:
return true;
// 1 byte values
case DW_FORM_data1:
case DW_FORM_flag:
case DW_FORM_ref1:
*offset_ptr += 1;
return true;
// 2 byte values
case DW_FORM_data2:
case DW_FORM_ref2:
*offset_ptr += 2;
return true;
// 32 bit for DWARF 32, 64 for DWARF 64
case DW_FORM_sec_offset:
case DW_FORM_strp:
*offset_ptr += (cu->IsDWARF64() ? 8 : 4);
return true;
// 4 byte values
case DW_FORM_data4:
case DW_FORM_ref4:
*offset_ptr += 4;
return true;
// 8 byte values
case DW_FORM_data8:
case DW_FORM_ref8:
case DW_FORM_ref_sig8:
*offset_ptr += 8;
return true;
// signed or unsigned LEB 128 values
case DW_FORM_sdata:
case DW_FORM_udata:
case DW_FORM_ref_udata:
debug_info_data.Skip_LEB128(offset_ptr);
return true;
case DW_FORM_indirect:
{
dw_form_t indirect_form = debug_info_data.GetULEB128(offset_ptr);
return DWARFFormValue::SkipValue (indirect_form,
debug_info_data,
offset_ptr,
cu);
}
default:
break;
}
return false;
}