LLDB mainline
|
#include <Type.h>
Classes | |
struct | ParsedName |
Public Types | |
enum | EncodingDataType { eEncodingInvalid , eEncodingIsUID , eEncodingIsConstUID , eEncodingIsRestrictUID , eEncodingIsVolatileUID , eEncodingIsTypedefUID , eEncodingIsPointerUID , eEncodingIsLValueReferenceUID , eEncodingIsRValueReferenceUID , eEncodingIsAtomicUID , eEncodingIsSyntheticUID , eEncodingIsLLVMPtrAuthUID } |
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) |
llvm::Expected< uint32_t > | GetNumChildren (bool omit_empty_base_classes) |
bool | IsAggregateType () |
bool | IsTemplateType () |
bool | IsValidType () |
bool | IsTypedef () |
lldb::TypeSP | GetTypedefType () |
ConstString | GetName () const |
ConstString | GetQualifiedName () |
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. | |
Public Member Functions inherited from lldb_private::UserID | |
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 std::optional< ParsedName > | GetTypeScopeAndBasename (llvm::StringRef name) |
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. | |
Protected Attributes inherited from lldb_private::UserID | |
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 276 of file Type.cpp.
References m_byte_size, and m_byte_size_has_value.
|
private |
Definition at line 297 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 372 of file Type.cpp.
References lldb_private::Declaration::Dump(), lldb_private::SymbolContextScope::DumpSymbolContext(), lldb_private::CompilerType::DumpTypeDescription(), eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLLVMPtrAuthUID, 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 450 of file Type.cpp.
References lldb_private::ConstString::Dump(), and GetName().
Referenced by lldb_private::Variable::Dump().
ConstString Type::GetBaseName | ( | ) |
Definition at line 446 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetTypeName().
std::optional< uint64_t > Type::GetByteSize | ( | ExecutionContextScope * | exe_scope | ) |
Definition at line 458 of file Type.cpp.
References eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLLVMPtrAuthUID, 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(), lldb_private::SymbolFileCTF::CompleteType(), lldb_private::SymbolFileCTF::CreateArray(), GetByteSize(), GetDescription(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseSingleMember(), and ReadFromMemory().
const Declaration & Type::GetDeclaration | ( | ) | const |
Definition at line 576 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 304 of file Type.cpp.
References lldb_private::Declaration::Dump(), lldb_private::CompilerType::DumpTypeDescription(), lldb::eDescriptionLevelVerbose, eEncodingInvalid, eEncodingIsAtomicUID, eEncodingIsConstUID, eEncodingIsLLVMPtrAuthUID, 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 528 of file Type.cpp.
References lldb_private::CompilerType::GetEncoding(), and GetForwardCompilerType().
uint32_t Type::GetEncodingMask | ( | ) |
Definition at line 755 of file Type.cpp.
References GetEncodingMask(), GetEncodingType(), and m_encoding_uid_type.
Referenced by GetEncodingMask(), and DWARFASTParserClang::ParseChildParameters().
|
protected |
Definition at line 452 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 847 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 526 of file Type.cpp.
References lldb_private::CompilerType::GetFormat(), and GetForwardCompilerType().
CompilerType Type::GetForwardCompilerType | ( | ) |
Definition at line 774 of file Type.cpp.
References Forward, m_compiler_type, and ResolveCompilerType().
Referenced by PDBASTParser::CreateLLDBTypeFromPDBType(), DWARFASTParserClang::CreateStaticMemberVariable(), Dump(), 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::ClangExpressionDeclMap::GetVariableValue(), InferPromiseType(), IsAggregateType(), IsTemplateType(), lldb_private::StackFrame::LegacyGetValueForVariableExpressionPath(), lldb_private::ClangExpressionDeclMap::LookUpLldbClass(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseChildParameters(), DWARFASTParserClang::ParseCXXMethod(), DWARFASTParserClang::ParsePointerToMemberType(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTemplateDIE(), PrivateAutoComplete(), ResolveCompilerType(), and lldb_private::ClangUserExpression::ScanContext().
CompilerType Type::GetFullCompilerType | ( | ) |
Definition at line 764 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(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
CompilerType Type::GetLayoutCompilerType | ( | ) |
Definition at line 769 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 841 of file Type.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), and m_symbol_file.
ConstString Type::GetName | ( | ) |
Definition at line 440 of file Type.cpp.
References GetForwardCompilerType(), lldb_private::CompilerType::GetTypeName(), and m_name.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::plugin::dwarf::SymbolFileDWARF::CompleteType(), lldb_private::Address::Dump(), lldb_private::SymbolContext::Dump(), DumpTypeName(), lldb::SBFunction::GetDescription(), GetDescription(), and lldb_private::ValueObjectVariable::GetTypeName().
|
inline |
llvm::Expected< uint32_t > Type::GetNumChildren | ( | bool | omit_empty_base_classes | ) |
Definition at line 504 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::GetNumChildren().
|
inline |
ConstString Type::GetQualifiedName | ( | ) |
Definition at line 779 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 476 of file Type.h.
References m_symbol_file.
Referenced by lldb_private::Variable::GetDecl(), lldb_private::Variable::GetDeclContext(), and ResolveCompilerType().
|
inline |
Definition at line 477 of file Type.h.
References m_symbol_file.
lldb::TypeSP Type::GetTypedefType | ( | ) |
Definition at line 516 of file Type.cpp.
References IsTypedef(), m_encoding_uid, m_symbol_file, and lldb_private::SymbolFile::ResolveTypeUID().
|
static |
Definition at line 784 of file Type.cpp.
References lldb_private::Type::ParsedName::basename, lldb_private::Type::ParsedName::scope, and lldb_private::Type::ParsedName::type_class.
Referenced by lldb_private::TypeQuery::TypeQuery().
bool Type::IsAggregateType | ( | ) |
Definition at line 508 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::IsAggregateType().
bool Type::IsTemplateType | ( | ) |
Definition at line 512 of file Type.cpp.
References GetForwardCompilerType(), and lldb_private::CompilerType::IsTemplateType().
|
inline |
Definition at line 494 of file Type.h.
References eEncodingIsTypedefUID, and m_encoding_uid_type.
Referenced by GetTypedefType().
|
inline |
Definition at line 492 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 533 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().
|
protected |
Definition at line 578 of file Type.cpp.
References lldb_private::CompilerType::AddConstModifier(), lldb_private::CompilerType::AddPtrAuthModifier(), 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, eEncodingIsLLVMPtrAuthUID, 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 GetForwardCompilerType(), GetFullCompilerType(), GetLayoutCompilerType(), and ResolveCompilerType().
|
inline |
Definition at line 566 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 584 of file Type.h.
Referenced by Dump(), GetByteSize(), GetDescription(), and Type().
|
protected |
Definition at line 585 of file Type.h.
Referenced by Dump(), GetByteSize(), and Type().
|
protected |
Definition at line 587 of file Type.h.
Referenced by Dump(), GetDescription(), GetExeModule(), GetForwardCompilerType(), GetFullCompilerType(), GetLayoutCompilerType(), and ResolveCompilerType().
|
protected |
Definition at line 588 of file Type.h.
Referenced by ResolveCompilerType().
|
protected |
The symbol context in which this type is defined.
Definition at line 580 of file Type.h.
Referenced by Dump(), GetSymbolContextScope(), and SetSymbolContextScope().
|
protected |
Definition at line 586 of file Type.h.
Referenced by Dump(), GetDeclaration(), and GetDescription().
|
protected |
Definition at line 581 of file Type.h.
Referenced by GetEncodingType(), and SetEncodingType().
|
protected |
Definition at line 582 of file Type.h.
Referenced by Dump(), GetDescription(), GetEncodingType(), GetTypedefType(), and ResolveCompilerType().
|
protected |
Definition at line 583 of file Type.h.
Referenced by Dump(), GetByteSize(), GetDescription(), GetEncodingMask(), IsTypedef(), IsValidType(), and ResolveCompilerType().
|
protected |
Definition at line 577 of file Type.h.
Referenced by Dump(), GetName(), and ResolveCompilerType().
|
protected |
Language-specific flags.
Definition at line 590 of file Type.h.
Referenced by GetPayload(), ResolveCompilerType(), and SetPayload().
|
protected |
Definition at line 578 of file Type.h.
Referenced by GetByteSize(), GetEncodingType(), GetModule(), GetSymbolFile(), GetTypedefType(), and ResolveCompilerType().