本文整理汇总了C++中DWARFDIE::HasChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ DWARFDIE::HasChildren方法的具体用法?C++ DWARFDIE::HasChildren怎么用?C++ DWARFDIE::HasChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DWARFDIE
的用法示例。
在下文中一共展示了DWARFDIE::HasChildren方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: switch
bool
DWARFASTParserJava::CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type,
lldb_private::CompilerType &java_type)
{
switch (die.Tag())
{
case DW_TAG_class_type:
{
if (die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0) == 0)
{
if (die.HasChildren())
ParseChildMembers(die, java_type);
m_ast.CompleteObjectType(java_type);
return java_type.IsValid();
}
}
break;
default:
assert(false && "Not a forward java type declaration!");
break;
}
return false;
}
示例3: if
//.........这里部分代码省略.........
}
}
DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", dwarf->MakeUserID(die.GetOffset()),
DW_TAG_value_to_name(tag), type_name_cstr);
bool compiler_type_was_created = false;
compiler_type.SetCompilerType(&m_ast, dwarf->m_forward_decl_die_to_clang_type.lookup(die.GetDIE()));
if (!compiler_type)
{
compiler_type_was_created = true;
compiler_type = m_ast.CreateStructType(go_kind, type_name_const_str, byte_size);
}
type_sp.reset(new Type(dwarf->MakeUserID(die.GetOffset()), dwarf, type_name_const_str, byte_size,
NULL, LLDB_INVALID_UID, Type::eEncodingIsUID, &decl, compiler_type,
Type::eResolveStateForward));
// Add our type to the unique type map so we don't
// end up creating many copies of the same type over
// and over in the ASTContext for our module
unique_ast_entry_ap->m_type_sp = type_sp;
unique_ast_entry_ap->m_die = die;
unique_ast_entry_ap->m_declaration = decl;
unique_ast_entry_ap->m_byte_size = byte_size;
dwarf->GetUniqueDWARFASTTypeMap().Insert(type_name_const_str, *unique_ast_entry_ap);
if (!is_forward_declaration)
{
// Always start the definition for a class type so that
// if the class has child classes or types that require
// the class to be created for use as their decl contexts
// the class will be ready to accept these child definitions.
if (die.HasChildren() == false)
{
// No children for this struct/union/class, lets finish it
m_ast.CompleteStructType(compiler_type);
}
else if (compiler_type_was_created)
{
// Leave this as a forward declaration until we need
// to know the details of the type. lldb_private::Type
// will automatically call the SymbolFile virtual function
// "SymbolFileDWARF::CompleteType(Type *)"
// When the definition needs to be defined.
dwarf->m_forward_decl_die_to_clang_type[die.GetDIE()] = compiler_type.GetOpaqueQualType();
dwarf->m_forward_decl_clang_type_to_die[compiler_type.GetOpaqueQualType()] = die.GetDIERef();
// SetHasExternalStorage (compiler_type.GetOpaqueQualType(), true);
}
}
}
break;
case DW_TAG_subprogram:
case DW_TAG_subroutine_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;
bool is_variadic = false;
clang::StorageClass storage = clang::SC_None; //, Extern, Static, PrivateExtern
const size_t num_attributes = die.GetAttributes(attributes);
if (num_attributes > 0)
{
uint32_t i;