LLDB
mainline
|
#include <Type.h>
Public Types | |
enum | EncodingDataType { eEncodingInvalid, eEncodingIsUID, eEncodingIsConstUID, eEncodingIsRestrictUID, eEncodingIsVolatileUID, eEncodingIsTypedefUID, eEncodingIsPointerUID, eEncodingIsLValueReferenceUID, eEncodingIsRValueReferenceUID, eEncodingIsAtomicUID, eEncodingIsSyntheticUID } |
enum | ResolveState : unsigned char { ResolveState::Unresolved = 0, ResolveState::Forward = 1, ResolveState::Layout = 2, ResolveState::Full = 3 } |
typedef uint32_t | Payload |
Public Member Functions | |
Type (lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name, llvm::Optional< uint64_t > byte_size, SymbolContextScope *context, lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type, const Declaration &decl, const CompilerType &compiler_qual_type, ResolveState compiler_type_resolve_state, uint32_t opaque_payload=0) | |
Type () | |
void | Dump (Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) |
void | DumpTypeName (Stream *s) |
lldb::ModuleSP | GetModule () |
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sure the module is still around before playing with Type instances. More... | |
lldb::ModuleSP | GetExeModule () |
GetModule may return module for compile unit's object file. More... | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope) |
SymbolFile * | GetSymbolFile () |
const SymbolFile * | GetSymbolFile () const |
ConstString | GetName () |
llvm::Optional< uint64_t > | GetByteSize (ExecutionContextScope *exe_scope) |
uint32_t | GetNumChildren (bool omit_empty_base_classes) |
bool | IsAggregateType () |
bool | IsValidType () |
bool | IsTypedef () |
lldb::TypeSP | GetTypedefType () |
ConstString | GetName () const |
ConstString | GetQualifiedName () |
void | DumpValue (ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, uint32_t data_offset, bool show_type, bool show_summary, bool verbose, lldb::Format format=lldb::eFormatDefault) |
bool | DumpValueInMemory (ExecutionContext *exe_ctx, Stream *s, lldb::addr_t address, AddressType address_type, bool show_types, bool show_summary, bool verbose) |
bool | ReadFromMemory (ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data) |
bool | WriteToMemory (ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data) |
bool | GetIsDeclaration () const |
void | SetIsDeclaration (bool b) |
bool | GetIsExternal () const |
void | SetIsExternal (bool b) |
lldb::Format | GetFormat () |
lldb::Encoding | GetEncoding (uint64_t &count) |
SymbolContextScope * | GetSymbolContextScope () |
const SymbolContextScope * | GetSymbolContextScope () const |
void | SetSymbolContextScope (SymbolContextScope *context) |
const lldb_private::Declaration & | GetDeclaration () const |
CompilerType | GetFullCompilerType () |
CompilerType | GetLayoutCompilerType () |
CompilerType | GetForwardCompilerType () |
void | SetEncodingType (Type *encoding_type) |
uint32_t | GetEncodingMask () |
Payload | GetPayload () |
Return the language-specific payload. More... | |
void | SetPayload (Payload opaque_payload) |
Return the language-specific payload. More... | |
![]() | |
UserID (lldb::user_id_t uid=LLDB_INVALID_UID) | |
Construct with optional user ID. More... | |
~UserID ()=default | |
Destructor. More... | |
void | Clear () |
Clears the object state. More... | |
lldb::user_id_t | GetID () const |
Get accessor for the user ID. More... | |
void | SetID (lldb::user_id_t uid) |
Set accessor for the user ID. More... | |
Static Public Member Functions | |
static int | Compare (const Type &a, const Type &b) |
static bool | GetTypeScopeAndBasename (llvm::StringRef name, llvm::StringRef &scope, llvm::StringRef &basename, lldb::TypeClass &type_class) |
Protected Member Functions | |
Type * | GetEncodingType () |
bool | ResolveCompilerType (ResolveState compiler_type_resolve_state) |
Protected Attributes | |
ConstString | m_name |
SymbolFile * | m_symbol_file = nullptr |
SymbolContextScope * | m_context = nullptr |
The symbol context in which this type is defined. More... | |
Type * | m_encoding_type = nullptr |
lldb::user_id_t | m_encoding_uid = LLDB_INVALID_UID |
EncodingDataType | m_encoding_uid_type = eEncodingInvalid |
uint64_t | m_byte_size: 63 |
uint64_t | m_byte_size_has_value: 1 |
Declaration | m_decl |
CompilerType | m_compiler_type |
ResolveState | m_compiler_type_resolve_state = ResolveState::Unresolved |
Payload | m_payload |
Language-specific flags. More... | |
![]() | |
lldb::user_id_t | m_uid |
The user ID that uniquely identifies an object. More... | |
typedef uint32_t lldb_private::Type::Payload |
|
strong |
Type::Type | ( | lldb::user_id_t | uid, |
SymbolFile * | symbol_file, | ||
ConstString | name, | ||
llvm::Optional< uint64_t > | byte_size, | ||
SymbolContextScope * | context, | ||
lldb::user_id_t | encoding_uid, | ||
EncodingDataType | encoding_uid_type, | ||
const Declaration & | decl, | ||
const CompilerType & | compiler_qual_type, | ||
ResolveState | compiler_type_resolve_state, | ||
uint32_t | opaque_payload = 0 |
||
) |
Definition at line 143 of file Type.cpp.
References m_byte_size, and m_byte_size_has_value.
Type::Type | ( | ) |
Definition at line 164 of file Type.cpp.
References m_byte_size, and m_byte_size_has_value.
void Type::Dump | ( | Stream * | s, |
bool | show_context, | ||
lldb::DescriptionLevel | level = lldb::eDescriptionLevelFull |
||
) |
Definition at line 236 of file Type.cpp.
References lldb_private::Declaration::Dump(), lldb_private::SymbolContextScope::DumpSymbolContext(), lldb_private::CompilerType::DumpTypeDescription(), eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLValueReferenceUID, eEncodingIsPointerUID, eEncodingIsRestrictUID, eEncodingIsRValueReferenceUID, eEncodingIsSyntheticUID, eEncodingIsTypedefUID, eEncodingIsUID, eEncodingIsVolatileUID, lldb_private::Stream::EOL(), lldb_private::Stream::Format(), GetForwardCompilerType(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::Stream::Indent(), lldb_private::CompilerType::IsValid(), LLDB_INVALID_UID, m_byte_size, m_byte_size_has_value, m_compiler_type, m_context, m_decl, m_encoding_uid, m_encoding_uid_type, m_name, lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by lldb_private::SymbolContext::Dump().
void Type::DumpTypeName | ( | Stream * | s | ) |
Definition at line 308 of file Type.cpp.
References lldb_private::ConstString::Dump(), and GetName().
Referenced by lldb_private::Variable::Dump(), and DumpValue().
void Type::DumpValue | ( | ExecutionContext * | exe_ctx, |
Stream * | s, | ||
const DataExtractor & | data, | ||
uint32_t | data_offset, | ||
bool | show_type, | ||
bool | show_summary, | ||
bool | verbose, | ||
lldb::Format | format = lldb::eFormatDefault |
||
) |
Definition at line 310 of file Type.cpp.
References DumpTypeName(), lldb_private::CompilerType::DumpValue(), lldb::eFormatDefault, Forward, lldb_private::ExecutionContext::GetBestExecutionContextScope(), GetByteSize(), GetFormat(), GetForwardCompilerType(), lldb_private::UserID::GetID(), lldb_private::Stream::Printf(), lldb_private::Stream::PutChar(), lldb_private::Stream::PutCString(), and ResolveCompilerType().
Referenced by DumpValueInMemory().
bool Type::DumpValueInMemory | ( | ExecutionContext * | exe_ctx, |
Stream * | s, | ||
lldb::addr_t | address, | ||
AddressType | address_type, | ||
bool | show_types, | ||
bool | show_summary, | ||
bool | verbose | ||
) |
Definition at line 409 of file Type.cpp.
References DumpValue(), lldb_private::Target::GetArchitecture(), lldb_private::ArchSpec::GetByteOrder(), lldb_private::ExecutionContext::GetTargetPtr(), LLDB_INVALID_ADDRESS, ReadFromMemory(), and lldb_private::DataExtractor::SetByteOrder().
llvm::Optional< uint64_t > Type::GetByteSize | ( | ExecutionContextScope * | exe_scope | ) |
Definition at line 340 of file Type.cpp.
References eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLValueReferenceUID, eEncodingIsPointerUID, eEncodingIsRestrictUID, eEncodingIsRValueReferenceUID, eEncodingIsSyntheticUID, eEncodingIsTypedefUID, eEncodingIsUID, eEncodingIsVolatileUID, lldb_private::ObjectFile::GetArchitecture(), GetByteSize(), GetEncodingType(), GetLayoutCompilerType(), lldb_private::SymbolFile::GetObjectFile(), m_byte_size, m_byte_size_has_value, m_encoding_uid_type, and m_symbol_file.
Referenced by DWARFASTParserClang::CompleteEnumType(), DWARFASTParserClang::CompleteRecordType(), DumpValue(), GetByteSize(), GetDescription(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseSingleMember(), and ReadFromMemory().
const Declaration & Type::GetDeclaration | ( | ) | const |
Definition at line 470 of file Type.cpp.
References m_decl.
Referenced by lldb_private::Block::AddRange(), and lldb_private::Function::GetStartLineSourceInfo().
void Type::GetDescription | ( | Stream * | s, |
lldb::DescriptionLevel | level, | ||
bool | show_name, | ||
ExecutionContextScope * | exe_scope | ||
) |
Definition at line 171 of file Type.cpp.
References lldb_private::Declaration::Dump(), lldb_private::CompilerType::DumpTypeDescription(), lldb::eDescriptionLevelVerbose, eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLValueReferenceUID, eEncodingIsPointerUID, eEncodingIsRestrictUID, eEncodingIsRValueReferenceUID, eEncodingIsSyntheticUID, eEncodingIsTypedefUID, eEncodingIsUID, eEncodingIsVolatileUID, GetByteSize(), GetForwardCompilerType(), GetName(), GetQualifiedName(), lldb_private::CompilerType::IsValid(), LLDB_INVALID_UID, m_byte_size, m_compiler_type, m_decl, m_encoding_uid, m_encoding_uid_type, lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by lldb_private::SymbolContext::GetDescription().
lldb::Encoding Type::GetEncoding | ( | uint64_t & | count | ) |
Definition at line 404 of file Type.cpp.
References lldb_private::CompilerType::GetEncoding(), and GetForwardCompilerType().
uint32_t Type::GetEncodingMask | ( | ) |
Definition at line 636 of file Type.cpp.
References GetEncodingMask(), GetEncodingType(), and m_encoding_uid_type.
Referenced by GetEncodingMask(), and DWARFASTParserClang::ParseChildParameters().
|
protected |
Definition at line 334 of file Type.cpp.
References LLDB_INVALID_UID, m_encoding_type, m_encoding_uid, m_symbol_file, and lldb_private::SymbolFile::ResolveTypeUID().
Referenced by GetByteSize(), GetEncodingMask(), and ResolveCompilerType().
ModuleSP Type::GetExeModule | ( | ) |
GetModule may return module for compile unit's object file.
GetExeModule returns module for executable object file that contains compile unit where type was actualy defined. GetModule and GetExeModule may return the same value.
Definition at line 727 of file Type.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), lldb_private::TypeSystem::GetSymbolFile(), lldb_private::CompilerType::GetTypeSystem(), and m_compiler_type.
lldb::Format Type::GetFormat | ( | ) |
Definition at line 402 of file Type.cpp.
References lldb_private::CompilerType::GetFormat(), and GetForwardCompilerType().
Referenced by DumpValue().
CompilerType Type::GetForwardCompilerType | ( | ) |
Definition at line 655 of file Type.cpp.
References Forward, m_compiler_type, and ResolveCompilerType().
Referenced by PDBASTParser::CreateLLDBTypeFromPDBType(), Dump(), DumpValue(), DWARFASTParserClang::GetClangDeclForDIE(), lldb_private::Value::GetCompilerType(), lldb_private::ValueObjectVariable::GetCompilerTypeImpl(), PDBASTParser::GetDeclForSymbol(), GetDescription(), lldb_private::ValueObjectVariable::GetDisplayTypeName(), GetEncoding(), GetFormat(), GetName(), GetNumChildren(), GetQualifiedName(), lldb_private::StackFrame::GetValueForVariableExpressionPath(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), IsAggregateType(), lldb_private::ClangExpressionDeclMap::LookUpLldbClass(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseChildParameters(), DWARFASTParserClang::ParsePointerToMemberType(), DWARFASTParserClang::ParseSingleMember(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTemplateDIE(), PrivateAutoComplete(), ResolveCompilerType(), and lldb_private::ClangUserExpression::ScanContext().
CompilerType Type::GetFullCompilerType | ( | ) |
Definition at line 645 of file Type.cpp.
References Full, m_compiler_type, and ResolveCompilerType().
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), PDBASTParser::AddRecordBases(), PDBASTParser::AddRecordMethod(), DWARFASTParserClang::CopyUniqueClassMethodTypes(), PDBASTParser::CreateLLDBTypeFromPDBType(), lldb_private::Function::GetCompilerType(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), lldb_private::ClangExpressionDeclMap::LookUpLldbClass(), lldb_private::ClangExpressionDeclMap::LookUpLldbObjCClass(), DWARFASTParserClang::ParseEnum(), DWARFASTParserClang::ParseInheritance(), and DWARFASTParserClang::ParseSubroutine().
bool lldb_private::Type::GetIsDeclaration | ( | ) | const |
bool lldb_private::Type::GetIsExternal | ( | ) | const |
CompilerType Type::GetLayoutCompilerType | ( | ) |
Definition at line 650 of file Type.cpp.
References Layout, m_compiler_type, and ResolveCompilerType().
Referenced by PDBASTParser::AddRecordMembers(), GetByteSize(), DWARFASTParserClang::ParseObjCProperty(), and DWARFASTParserClang::ParseSingleMember().
ModuleSP Type::GetModule | ( | ) |
Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sure the module is still around before playing with Type instances.
They can store a weak pointer to the Module;
Definition at line 721 of file Type.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), and m_symbol_file.
ConstString Type::GetName | ( | ) |
Definition at line 302 of file Type.cpp.
References GetForwardCompilerType(), lldb_private::CompilerType::GetTypeName(), and m_name.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), SymbolFileDWARF::CompleteType(), lldb_private::SymbolContext::Dump(), lldb_private::Address::Dump(), DumpTypeName(), lldb::SBFunction::GetDescription(), GetDescription(), lldb_private::ValueObjectVariable::GetTypeName(), and DWARFASTParserClang::ParseSubroutine().
|
inline |
uint32_t Type::GetNumChildren | ( | bool | omit_empty_base_classes | ) |
Definition at line 384 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetNumChildren().
|
inline |
ConstString Type::GetQualifiedName | ( | ) |
Definition at line 660 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetTypeName().
Referenced by GetDescription(), and lldb_private::ValueObjectVariable::GetQualifiedTypeName().
|
inline |
|
inline |
|
inline |
Definition at line 133 of file Type.h.
References m_symbol_file.
Referenced by lldb_private::Variable::GetDecl(), lldb_private::Variable::GetDeclContext(), and ResolveCompilerType().
|
inline |
Definition at line 134 of file Type.h.
References m_symbol_file.
lldb::TypeSP Type::GetTypedefType | ( | ) |
Definition at line 392 of file Type.cpp.
References IsTypedef(), m_encoding_uid, m_symbol_file, and lldb_private::SymbolFile::ResolveTypeUID().
|
static |
Definition at line 664 of file Type.cpp.
Referenced by lldb_private::Module::FindTypes(), lldb_private::TypeList::RemoveMismatchedTypes(), and lldb_private::TypeMap::RemoveMismatchedTypes().
bool Type::IsAggregateType | ( | ) |
Definition at line 388 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::IsAggregateType().
|
inline |
Definition at line 146 of file Type.h.
References eEncodingIsTypedefUID, and m_encoding_uid_type.
Referenced by GetTypedefType().
|
inline |
Definition at line 144 of file Type.h.
References eEncodingInvalid, and m_encoding_uid_type.
bool Type::ReadFromMemory | ( | ExecutionContext * | exe_ctx, |
lldb::addr_t | address, | ||
AddressType | address_type, | ||
DataExtractor & | data | ||
) |
Definition at line 427 of file Type.cpp.
References lldb_private::eAddressTypeFile, lldb_private::eAddressTypeHost, error(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), GetByteSize(), lldb_private::DataExtractor::GetByteSize(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::DataExtractor::PeekData(), lldb_private::Process::ReadMemory(), and lldb_private::DataExtractor::SetData().
Referenced by DumpValueInMemory().
|
protected |
Definition at line 472 of file Type.cpp.
References lldb_private::CompilerType::AddConstModifier(), lldb_private::CompilerType::AddRestrictModifier(), lldb_private::CompilerType::AddVolatileModifier(), lldb_private::ConstString::AsCString(), lldb_private::ConstString::Clear(), lldb_private::SymbolFile::CompleteType(), lldb_private::CompilerType::CreateTypedef(), lldb::eBasicTypeVoid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLValueReferenceUID, eEncodingIsPointerUID, eEncodingIsRestrictUID, eEncodingIsRValueReferenceUID, eEncodingIsTypedefUID, eEncodingIsUID, eEncodingIsVolatileUID, lldb::eLanguageTypeC, Forward, Full, lldb_private::CompilerType::GetAtomicType(), lldb_private::CompilerType::GetBasicTypeFromAST(), GetEncodingType(), GetForwardCompilerType(), lldb_private::UserID::GetID(), lldb_private::GetLog(), lldb_private::CompilerType::GetLValueReferenceType(), lldb_private::CompilerType::GetPointerType(), lldb_private::CompilerType::GetRValueReferenceType(), GetSymbolFile(), lldb_private::SymbolFile::GetTypeSystemForLanguage(), lldb_private::CompilerType::IsDefined(), lldb_private::CompilerType::IsValid(), Layout, LLDB_INVALID_UID, LLDB_LOG_ERROR, m_compiler_type, m_compiler_type_resolve_state, m_encoding_uid, m_encoding_uid_type, m_name, m_payload, m_symbol_file, ResolveCompilerType(), and lldb_private::Symbols.
Referenced by DumpValue(), GetForwardCompilerType(), GetFullCompilerType(), GetLayoutCompilerType(), and ResolveCompilerType().
|
inline |
Definition at line 210 of file Type.h.
References m_encoding_type.
void lldb_private::Type::SetIsDeclaration | ( | bool | b | ) |
void lldb_private::Type::SetIsExternal | ( | bool | b | ) |
|
inline |
|
inline |
bool Type::WriteToMemory | ( | ExecutionContext * | exe_ctx, |
lldb::addr_t | address, | ||
AddressType | address_type, | ||
DataExtractor & | data | ||
) |
|
protected |
Definition at line 228 of file Type.h.
Referenced by Dump(), GetByteSize(), GetDescription(), and Type().
|
protected |
Definition at line 229 of file Type.h.
Referenced by Dump(), GetByteSize(), and Type().
|
protected |
Definition at line 231 of file Type.h.
Referenced by Dump(), GetDescription(), GetExeModule(), GetForwardCompilerType(), GetFullCompilerType(), GetLayoutCompilerType(), and ResolveCompilerType().
|
protected |
Definition at line 232 of file Type.h.
Referenced by ResolveCompilerType().
|
protected |
The symbol context in which this type is defined.
Definition at line 224 of file Type.h.
Referenced by Dump(), GetSymbolContextScope(), and SetSymbolContextScope().
|
protected |
Definition at line 230 of file Type.h.
Referenced by Dump(), GetDeclaration(), and GetDescription().
|
protected |
Definition at line 225 of file Type.h.
Referenced by GetEncodingType(), and SetEncodingType().
|
protected |
Definition at line 226 of file Type.h.
Referenced by Dump(), GetDescription(), GetEncodingType(), GetTypedefType(), and ResolveCompilerType().
|
protected |
Definition at line 227 of file Type.h.
Referenced by Dump(), GetByteSize(), GetDescription(), GetEncodingMask(), IsTypedef(), IsValidType(), and ResolveCompilerType().
|
protected |
Definition at line 221 of file Type.h.
Referenced by Dump(), GetName(), and ResolveCompilerType().
|
protected |
Language-specific flags.
Definition at line 234 of file Type.h.
Referenced by GetPayload(), ResolveCompilerType(), and SetPayload().
|
protected |
Definition at line 222 of file Type.h.
Referenced by GetByteSize(), GetEncodingType(), GetModule(), GetSymbolFile(), GetTypedefType(), and ResolveCompilerType().