Added the ability to get the type that a typedef points to via:
SBType SBType::GetTypedefedType(); Also added the ability to get a type by type ID from a SBModule: SBType SBModule::GetTypeByID (lldb::user_id_t uid); llvm-svn: 199939
This commit is contained in:
parent
b1ce33379a
commit
1f4db7da8f
|
@ -235,6 +235,25 @@ public:
|
|||
lldb::SBTypeList
|
||||
FindTypes (const char* type);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Get a type using its type ID.
|
||||
///
|
||||
/// Each symbol file reader will assign different user IDs to their
|
||||
/// types, but it is sometimes useful when debugging type issues to
|
||||
/// be able to grab a type using its type ID.
|
||||
///
|
||||
/// For DWARF debug info, the type ID is the DIE offset.
|
||||
///
|
||||
/// @param[in] uid
|
||||
/// The type user ID.
|
||||
///
|
||||
/// @return
|
||||
/// An SBType for the given type ID, or an empty SBType if the
|
||||
/// type was not found.
|
||||
//------------------------------------------------------------------
|
||||
lldb::SBType
|
||||
GetTypeByID (lldb::user_id_t uid);
|
||||
|
||||
lldb::SBType
|
||||
GetBasicType(lldb::BasicType type);
|
||||
|
||||
|
|
|
@ -105,6 +105,9 @@ public:
|
|||
lldb::SBType
|
||||
GetReferenceType();
|
||||
|
||||
lldb::SBType
|
||||
GetTypedefedType();
|
||||
|
||||
lldb::SBType
|
||||
GetDereferencedType();
|
||||
|
||||
|
|
|
@ -417,7 +417,15 @@ public:
|
|||
return type_sp->GetClangLayoutType().GetLValueReferenceType();
|
||||
return clang_type.GetLValueReferenceType();
|
||||
}
|
||||
|
||||
|
||||
ClangASTType
|
||||
GetTypedefedType () const
|
||||
{
|
||||
if (type_sp)
|
||||
return type_sp->GetClangFullType().GetTypedefedType();
|
||||
return clang_type.GetTypedefedType();
|
||||
}
|
||||
|
||||
ClangASTType
|
||||
GetDereferencedType () const
|
||||
{
|
||||
|
@ -512,6 +520,9 @@ public:
|
|||
TypeImpl
|
||||
GetReferenceType () const;
|
||||
|
||||
TypeImpl
|
||||
GetTypedefedType () const;
|
||||
|
||||
TypeImpl
|
||||
GetDereferencedType () const;
|
||||
|
||||
|
|
|
@ -230,6 +230,9 @@ public:
|
|||
lldb::SBTypeList
|
||||
FindTypes (const char* type);
|
||||
|
||||
lldb::SBType
|
||||
GetTypeByID (lldb::user_id_t uid);
|
||||
|
||||
lldb::SBType
|
||||
GetBasicType(lldb::BasicType type);
|
||||
|
||||
|
|
|
@ -177,6 +177,9 @@ public:
|
|||
lldb::SBType
|
||||
GetReferenceType();
|
||||
|
||||
lldb::SBType
|
||||
SBType::GetTypedefedType();
|
||||
|
||||
lldb::SBType
|
||||
GetDereferencedType();
|
||||
|
||||
|
|
|
@ -579,6 +579,23 @@ SBModule::FindTypes (const char *type)
|
|||
return retval;
|
||||
}
|
||||
|
||||
lldb::SBType
|
||||
SBModule::GetTypeByID (lldb::user_id_t uid)
|
||||
{
|
||||
ModuleSP module_sp (GetSP ());
|
||||
if (module_sp)
|
||||
{
|
||||
SymbolVendor* vendor = module_sp->GetSymbolVendor();
|
||||
if (vendor)
|
||||
{
|
||||
Type *type_ptr = vendor->ResolveTypeUID(uid);
|
||||
if (type_ptr)
|
||||
return SBType(type_ptr->shared_from_this());
|
||||
}
|
||||
}
|
||||
return SBType();
|
||||
}
|
||||
|
||||
lldb::SBTypeList
|
||||
SBModule::GetTypes (uint32_t type_mask)
|
||||
{
|
||||
|
|
|
@ -185,6 +185,14 @@ SBType::GetReferenceType()
|
|||
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetReferenceType())));
|
||||
}
|
||||
|
||||
SBType
|
||||
SBType::GetTypedefedType()
|
||||
{
|
||||
if (!IsValid())
|
||||
return SBType();
|
||||
return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetTypedefedType())));
|
||||
}
|
||||
|
||||
SBType
|
||||
SBType::GetDereferencedType()
|
||||
{
|
||||
|
|
|
@ -1083,6 +1083,16 @@ TypeImpl::GetReferenceType () const
|
|||
return TypeImpl(m_static_type.GetReferenceType());
|
||||
}
|
||||
|
||||
TypeImpl
|
||||
TypeImpl::GetTypedefedType () const
|
||||
{
|
||||
if (m_dynamic_type.IsValid())
|
||||
{
|
||||
return TypeImpl(m_static_type, m_dynamic_type.GetTypedefedType());
|
||||
}
|
||||
return TypeImpl(m_static_type.GetTypedefedType());
|
||||
}
|
||||
|
||||
TypeImpl
|
||||
TypeImpl::GetDereferencedType () const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue