本文整理汇总了C++中DWARFDIE::GetOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFDIE::GetOffset方法的具体用法?C++ DWARFDIE::GetOffset怎么用?C++ DWARFDIE::GetOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFDIE
的用法示例。
在下文中一共展示了DWARFDIE::GetOffset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sc
bool
DWARFASTParserGo::CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type, CompilerType &compiler_type)
{
if (!die)
return false;
const dw_tag_t tag = die.Tag();
SymbolFileDWARF *dwarf = die.GetDWARF();
Log *log = nullptr; // (LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO|DWARF_LOG_TYPE_COMPLETION));
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(
log, "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...", dwarf->MakeUserID(die.GetOffset()),
DW_TAG_value_to_name(tag), type->GetName().AsCString());
assert(compiler_type);
DWARFAttributes attributes;
switch (tag)
{
case DW_TAG_structure_type:
{
{
if (die.HasChildren())
{
SymbolContext sc(die.GetLLDBCompileUnit());
ParseChildMembers(sc, die, compiler_type);
}
}
m_ast.CompleteStructType(compiler_type);
return (bool)compiler_type;
}
default:
assert(false && "not a forward go type decl!");
break;
}
return false;
}
示例2: if
TypeSP
DWARFASTParserGo::ParseTypeFromDWARF(const lldb_private::SymbolContext &sc, const DWARFDIE &die, lldb_private::Log *log,
bool *type_is_new_ptr)
{
TypeSP type_sp;
if (type_is_new_ptr)
*type_is_new_ptr = false;
if (die)
{
SymbolFileDWARF *dwarf = die.GetDWARF();
if (log)
{
dwarf->GetObjectFile()->GetModule()->LogMessage(
log, "DWARFASTParserGo::ParseTypeFromDWARF (die = 0x%8.8x) %s name = '%s')", die.GetOffset(),
DW_TAG_value_to_name(die.Tag()), die.GetName());
}
Type *type_ptr = dwarf->m_die_to_type.lookup(die.GetDIE());
TypeList *type_list = dwarf->GetTypeList();
if (type_ptr == NULL)
{
if (type_is_new_ptr)
*type_is_new_ptr = true;
const dw_tag_t tag = die.Tag();
bool is_forward_declaration = false;
DWARFAttributes attributes;
const char *type_name_cstr = NULL;
ConstString type_name_const_str;
Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
uint64_t byte_size = 0;
uint64_t go_kind = 0;
Declaration decl;
Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID;
CompilerType compiler_type;
DWARFFormValue form_value;
dw_attr_t attr;
switch (tag)
{
case DW_TAG_base_type:
case DW_TAG_pointer_type:
case DW_TAG_typedef:
case DW_TAG_unspecified_type:
{
// Set a bit that lets us know that we are currently parsing this
dwarf->m_die_to_type[die.GetDIE()] = DIE_IS_BEING_PARSED;
const size_t num_attributes = die.GetAttributes(attributes);
lldb::user_id_t encoding_uid = LLDB_INVALID_UID;
if (num_attributes > 0)
{
uint32_t i;
for (i = 0; i < num_attributes; ++i)
{
attr = attributes.AttributeAtIndex(i);
if (attributes.ExtractFormValueAtIndex(i, form_value))
{
switch (attr)
{
case DW_AT_name:
type_name_cstr = form_value.AsCString();
if (type_name_cstr)
type_name_const_str.SetCString(type_name_cstr);
break;
case DW_AT_byte_size:
byte_size = form_value.Unsigned();
break;
case DW_AT_encoding:
// = form_value.Unsigned();
break;
case DW_AT_type:
encoding_uid = form_value.Reference();
break;
case DW_AT_go_kind:
go_kind = form_value.Unsigned();
break;
default:
// Do we care about DW_AT_go_key or DW_AT_go_elem?
break;
}
}
}
}
DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8lx\n", dwarf->MakeUserID(die.GetOffset()),
DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid);
switch (tag)
{
default:
break;
case DW_TAG_unspecified_type:
//.........这里部分代码省略.........