LLDB mainline
|
#include <Type.h>
Public Types | |
enum | EncodingDataType { eEncodingInvalid , eEncodingIsUID , eEncodingIsConstUID , eEncodingIsRestrictUID , eEncodingIsVolatileUID , eEncodingIsTypedefUID , eEncodingIsPointerUID , eEncodingIsLValueReferenceUID , eEncodingIsRValueReferenceUID , eEncodingIsAtomicUID , eEncodingIsSyntheticUID } |
enum class | ResolveState : unsigned char { Unresolved = 0 , Forward = 1 , Layout = 2 , Full = 3 } |
typedef uint32_t | Payload |
Public Member Functions | |
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. | |
lldb::ModuleSP | GetExeModule () |
GetModule may return module for compile unit's object file. | |
void | GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope) |
SymbolFile * | GetSymbolFile () |
const SymbolFile * | GetSymbolFile () const |
ConstString | GetName () |
ConstString | GetBaseName () |
std::optional< uint64_t > | GetByteSize (ExecutionContextScope *exe_scope) |
uint32_t | GetNumChildren (bool omit_empty_base_classes) |
bool | IsAggregateType () |
bool | IsTemplateType () |
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) |
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. | |
void | SetPayload (Payload opaque_payload) |
Return the language-specific payload. | |
![]() | |
UserID (lldb::user_id_t uid=LLDB_INVALID_UID) | |
Construct with optional user ID. | |
~UserID ()=default | |
Destructor. | |
void | Clear () |
Clears the object state. | |
lldb::user_id_t | GetID () const |
Get accessor for the user ID. | |
void | SetID (lldb::user_id_t uid) |
Set accessor for the user ID. | |
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. | |
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. | |
![]() | |
lldb::user_id_t | m_uid |
The user ID that uniquely identifies an object. | |
Private Member Functions | |
Type (lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name, std::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 () | |
Type (Type &t)=default | |
Type (Type &&t)=default | |
Type & | operator= (const Type &t)=default |
Type & | operator= (Type &&t)=default |
Friends | |
class | lldb_private::SymbolFileCommon |
Only allow Symbol File to create types, as they should own them by keeping them in their TypeList. | |
typedef uint32_t lldb_private::Type::Payload |
|
strong |
|
private |
Definition at line 144 of file Type.cpp.
References m_byte_size, and m_byte_size_has_value.
|
private |
Definition at line 165 of file Type.cpp.
References m_byte_size, and m_byte_size_has_value.
|
privatedefault |
|
privatedefault |
void Type::Dump | ( | Stream * | s, |
bool | show_context, | ||
lldb::DescriptionLevel | level = lldb::eDescriptionLevelFull |
||
) |
Definition at line 237 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 313 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 315 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 419 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().
ConstString Type::GetBaseName | ( | ) |
Definition at line 309 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetTypeName().
std::optional< uint64_t > Type::GetByteSize | ( | ExecutionContextScope * | exe_scope | ) |
Definition at line 345 of file Type.cpp.
References eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLValueReferenceUID, eEncodingIsPointerUID, eEncodingIsRestrictUID, eEncodingIsRValueReferenceUID, eEncodingIsSyntheticUID, eEncodingIsTypedefUID, eEncodingIsUID, eEncodingIsVolatileUID, lldb_private::ObjectFile::GetArchitecture(), GetByteSize(), lldb_private::CompilerType::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(), lldb_private::SymbolFileCTF::CompleteType(), lldb_private::SymbolFileCTF::CreateArray(), DumpValue(), GetByteSize(), GetDescription(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseSingleMember(), and ReadFromMemory().
const Declaration & Type::GetDeclaration | ( | ) | const |
Definition at line 480 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 172 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 414 of file Type.cpp.
References lldb_private::CompilerType::GetEncoding(), and GetForwardCompilerType().
uint32_t Type::GetEncodingMask | ( | ) |
Definition at line 649 of file Type.cpp.
References GetEncodingMask(), GetEncodingType(), and m_encoding_uid_type.
Referenced by GetEncodingMask(), and DWARFASTParserClang::ParseChildParameters().
|
protected |
Definition at line 339 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 actually defined. GetModule and GetExeModule may return the same value.
Definition at line 740 of file Type.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), lldb_private::CompilerType::GetTypeSystem(), and m_compiler_type.
lldb::Format Type::GetFormat | ( | ) |
Definition at line 412 of file Type.cpp.
References lldb_private::CompilerType::GetFormat(), and GetForwardCompilerType().
Referenced by DumpValue().
CompilerType Type::GetForwardCompilerType | ( | ) |
Definition at line 668 of file Type.cpp.
References Forward, m_compiler_type, and ResolveCompilerType().
Referenced by PDBASTParser::CreateLLDBTypeFromPDBType(), Dump(), DumpValue(), GetBaseName(), 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(), InferPromiseType(), IsAggregateType(), IsTemplateType(), lldb_private::ClangExpressionDeclMap::LookUpLldbClass(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseChildParameters(), DWARFASTParserClang::ParsePointerToMemberType(), DWARFASTParserClang::ParseSingleMember(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTemplateDIE(), PrivateAutoComplete(), lldb_private::TypeMap::RemoveMismatchedTypes(), ResolveCompilerType(), and lldb_private::ClangUserExpression::ScanContext().
CompilerType Type::GetFullCompilerType | ( | ) |
Definition at line 658 of file Type.cpp.
References Full, m_compiler_type, and ResolveCompilerType().
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), PDBASTParser::AddRecordBases(), PDBASTParser::AddRecordMethod(), lldb_private::SymbolFileCTF::CompleteType(), DWARFASTParserClang::CopyUniqueClassMethodTypes(), lldb_private::SymbolFileCTF::CreateArray(), lldb_private::SymbolFileCTF::CreateFunction(), PDBASTParser::CreateLLDBTypeFromPDBType(), lldb_private::SymbolFileCTF::CreateModifier(), lldb_private::SymbolFileCTF::CreateTypedef(), lldb_private::Function::GetCompilerType(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), lldb_private::ClangExpressionDeclMap::LookUpLldbObjCClass(), DWARFASTParserClang::ParseEnum(), lldb_private::SymbolFileCTF::ParseFunctions(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParseSubroutine(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
CompilerType Type::GetLayoutCompilerType | ( | ) |
Definition at line 663 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 734 of file Type.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), and m_symbol_file.
ConstString Type::GetName | ( | ) |
Definition at line 303 of file Type.cpp.
References GetForwardCompilerType(), lldb_private::CompilerType::GetTypeName(), and m_name.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), SymbolFileDWARF::CompleteType(), lldb_private::Address::Dump(), lldb_private::SymbolContext::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 390 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetNumChildren().
|
inline |
ConstString Type::GetQualifiedName | ( | ) |
Definition at line 673 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetTypeName().
Referenced by GetDescription(), lldb_private::ValueObjectVariable::GetQualifiedTypeName(), and lldb_private::TypeMap::RemoveMismatchedTypes().
|
inline |
|
inline |
|
inline |
Definition at line 125 of file Type.h.
References m_symbol_file.
Referenced by lldb_private::Variable::GetDecl(), lldb_private::Variable::GetDeclContext(), and ResolveCompilerType().
|
inline |
Definition at line 126 of file Type.h.
References m_symbol_file.
lldb::TypeSP Type::GetTypedefType | ( | ) |
Definition at line 402 of file Type.cpp.
References IsTypedef(), m_encoding_uid, m_symbol_file, and lldb_private::SymbolFile::ResolveTypeUID().
|
static |
Definition at line 677 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 394 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::IsAggregateType().
bool Type::IsTemplateType | ( | ) |
Definition at line 398 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::IsTemplateType().
|
inline |
Definition at line 143 of file Type.h.
References eEncodingIsTypedefUID, and m_encoding_uid_type.
Referenced by GetTypedefType().
|
inline |
Definition at line 141 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 437 of file Type.cpp.
References lldb_private::eAddressTypeFile, lldb_private::eAddressTypeHost, error(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::DataExtractor::GetByteSize(), 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 482 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 199 of file Type.h.
References m_encoding_type.
|
inline |
|
inline |
bool Type::WriteToMemory | ( | ExecutionContext * | exe_ctx, |
lldb::addr_t | address, | ||
AddressType | address_type, | ||
DataExtractor & | data | ||
) |
|
friend |
|
protected |
Definition at line 217 of file Type.h.
Referenced by Dump(), GetByteSize(), GetDescription(), and Type().
|
protected |
Definition at line 218 of file Type.h.
Referenced by Dump(), GetByteSize(), and Type().
|
protected |
Definition at line 220 of file Type.h.
Referenced by Dump(), GetDescription(), GetExeModule(), GetForwardCompilerType(), GetFullCompilerType(), GetLayoutCompilerType(), and ResolveCompilerType().
|
protected |
Definition at line 221 of file Type.h.
Referenced by ResolveCompilerType().
|
protected |
The symbol context in which this type is defined.
Definition at line 213 of file Type.h.
Referenced by Dump(), GetSymbolContextScope(), and SetSymbolContextScope().
|
protected |
Definition at line 219 of file Type.h.
Referenced by Dump(), GetDeclaration(), and GetDescription().
|
protected |
Definition at line 214 of file Type.h.
Referenced by GetEncodingType(), and SetEncodingType().
|
protected |
Definition at line 215 of file Type.h.
Referenced by Dump(), GetDescription(), GetEncodingType(), GetTypedefType(), and ResolveCompilerType().
|
protected |
Definition at line 216 of file Type.h.
Referenced by Dump(), GetByteSize(), GetDescription(), GetEncodingMask(), IsTypedef(), IsValidType(), and ResolveCompilerType().
|
protected |
Definition at line 210 of file Type.h.
Referenced by Dump(), GetName(), and ResolveCompilerType().
|
protected |
Language-specific flags.
Definition at line 223 of file Type.h.
Referenced by GetPayload(), ResolveCompilerType(), and SetPayload().
|
protected |
Definition at line 211 of file Type.h.
Referenced by GetByteSize(), GetEncodingType(), GetModule(), GetSymbolFile(), GetTypedefType(), and ResolveCompilerType().