LLDB  mainline
Classes | Public Member Functions | List of all members
lldb_private::ClangExpressionDeclMap Class Reference

"lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are defined in LLDB's debug information. More...

#include <ClangExpressionDeclMap.h>

Inheritance diagram for lldb_private::ClangExpressionDeclMap:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::ClangExpressionDeclMap:
Collaboration graph
[legend]

Classes

struct  TargetInfo
 [Used by IRInterpreter] Get basic target information. More...
 

Public Member Functions

 ClangExpressionDeclMap (bool keep_result_in_memory, Materializer::PersistentVariableDelegate *result_delegate, ExecutionContext &exe_ctx, ValueObject *ctx_obj)
 Constructor. More...
 
 ~ClangExpressionDeclMap () override
 Destructor. More...
 
bool WillParse (ExecutionContext &exe_ctx, Materializer *materializer)
 Enable the state needed for parsing and IR transformation. More...
 
void InstallCodeGenerator (clang::ASTConsumer *code_gen)
 
bool ResolveUnknownTypes ()
 [Used by ClangExpressionParser] For each variable that had an unknown type at the beginning of parsing, determine its final type now. More...
 
void DidParse ()
 Disable the state needed for parsing and IR transformation. More...
 
bool AddPersistentVariable (const clang::NamedDecl *decl, ConstString name, TypeFromParser type, bool is_result, bool is_lvalue)
 [Used by IRForTarget] Add a variable to the list of persistent variables for the process. More...
 
bool AddValueToStruct (const clang::NamedDecl *decl, ConstString name, llvm::Value *value, size_t size, lldb::offset_t alignment)
 [Used by IRForTarget] Add a variable to the struct that needs to be materialized each time the expression runs. More...
 
bool DoStructLayout ()
 [Used by IRForTarget] Finalize the struct, laying out the position of each object in it. More...
 
bool GetStructInfo (uint32_t &num_elements, size_t &size, lldb::offset_t &alignment)
 [Used by IRForTarget] Get general information about the laid-out struct after DoStructLayout() has been called. More...
 
bool GetStructElement (const clang::NamedDecl *&decl, llvm::Value *&value, lldb::offset_t &offset, ConstString &name, uint32_t index)
 [Used by IRForTarget] Get specific information about one field of the laid-out struct after DoStructLayout() has been called. More...
 
bool GetFunctionInfo (const clang::NamedDecl *decl, uint64_t &ptr)
 [Used by IRForTarget] Get information about a function given its Decl. More...
 
lldb::addr_t GetSymbolAddress (Target &target, Process *process, ConstString name, lldb::SymbolType symbol_type, Module *module=NULL)
 [Used by IRForTarget] Get the address of a symbol given nothing but its name. More...
 
lldb::addr_t GetSymbolAddress (ConstString name, lldb::SymbolType symbol_type)
 
TargetInfo GetTargetInfo ()
 
void FindExternalVisibleDecls (NameSearchContext &context) override
 [Used by ClangASTSource] Find all entities matching a given name, using a NameSearchContext to make Decls for them. More...
 
void FindExternalVisibleDecls (NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl, unsigned int current_id)
 Find all entities matching a given name in a given module/namespace, using a NameSearchContext to make Decls for them. More...
 
- Public Member Functions inherited from lldb_private::ClangASTSource
 ClangASTSource (const lldb::TargetSP &target)
 Constructor. More...
 
 ~ClangASTSource () override
 Destructor. More...
 
clang::Decl * GetExternalDecl (uint32_t) override
 Interface stubs. More...
 
clang::Stmt * GetExternalDeclStmt (uint64_t) override
 
clang::Selector GetExternalSelector (uint32_t) override
 
uint32_t GetNumExternalSelectors () override
 
clang::CXXBaseSpecifier * GetExternalCXXBaseSpecifiers (uint64_t Offset) override
 
void MaterializeVisibleDecls (const clang::DeclContext *DC)
 
void InstallASTContext (clang::ASTContext &ast_context, clang::FileManager &file_manager, bool is_shared_context=false)
 
bool FindExternalVisibleDeclsByName (const clang::DeclContext *DC, clang::DeclarationName Name) override
 Look up all Decls that match a particular name. More...
 
void FindExternalLexicalDecls (const clang::DeclContext *DC, llvm::function_ref< bool(clang::Decl::Kind)> IsKindWeWant, llvm::SmallVectorImpl< clang::Decl *> &Decls) override
 Enumerate all Decls in a given lexical context. More...
 
bool layoutRecordType (const clang::RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap< const clang::FieldDecl *, uint64_t > &FieldOffsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &BaseOffsets, llvm::DenseMap< const clang::CXXRecordDecl *, clang::CharUnits > &VirtualBaseOffsets) override
 Specify the layout of the contents of a RecordDecl. More...
 
void CompleteType (clang::TagDecl *Tag) override
 Complete a TagDecl. More...
 
void CompleteType (clang::ObjCInterfaceDecl *Class) override
 Complete an ObjCInterfaceDecl. More...
 
void StartTranslationUnit (clang::ASTConsumer *Consumer) override
 Called on entering a translation unit. More...
 
void CompleteNamespaceMap (ClangASTImporter::NamespaceMapSP &namespace_map, ConstString name, ClangASTImporter::NamespaceMapSP &parent_map) const override
 Look up the modules containing a given namespace and put the appropriate entries in the namespace map. More...
 
clang::NamespaceDecl * AddNamespace (NameSearchContext &context, ClangASTImporter::NamespaceMapSP &namespace_decls)
 
clang::Sema * getSema ()
 
void SetImportInProgress (bool import_in_progress)
 
bool GetImportInProgress ()
 
void SetLookupsEnabled (bool lookups_enabled)
 
bool GetLookupsEnabled ()
 
clang::ExternalASTSource * CreateProxy ()
 
bool IgnoreName (const ConstString name, bool ignore_all_dollar_names)
 Returns true if a name should be ignored by name lookup. More...
 
clang::Decl * CopyDecl (clang::Decl *src_decl)
 Copies a single Decl into the parser's AST context. More...
 
clang::QualType CopyTypeWithMerger (clang::ASTContext &src_context, clang::ExternalASTMerger &merger, clang::QualType type)
 Copies a single Type to the target of the given ExternalASTMerger. More...
 
bool ResolveDeclOrigin (const clang::Decl *decl, clang::Decl **original_decl, clang::ASTContext **original_ctx)
 Determined the origin of a single Decl, if it can be found. More...
 
clang::ExternalASTMerger & GetMergerUnchecked ()
 Returns m_merger_up. More...
 
bool HasMerger ()
 Returns true if there is a merger. More...
 
- Public Member Functions inherited from lldb_private::ClangExternalASTSourceCommon
 ClangExternalASTSourceCommon ()
 
 ~ClangExternalASTSourceCommon () override
 
ClangASTMetadataGetMetadata (const void *object)
 
void SetMetadata (const void *object, ClangASTMetadata &metadata)
 
bool HasMetadata (const void *object)
 
- Public Member Functions inherited from lldb_private::ClangASTImporter::MapCompleter
virtual ~MapCompleter ()
 

Additional Inherited Members

- Static Public Member Functions inherited from lldb_private::ClangExternalASTSourceCommon
static ClangExternalASTSourceCommonLookup (clang::ExternalASTSource *source)
 
- Protected Member Functions inherited from lldb_private::ClangASTSource
clang::ObjCInterfaceDecl * GetCompleteObjCInterface (const clang::ObjCInterfaceDecl *interface_decl)
 Look for the complete version of an Objective-C interface, and return it if found. More...
 
void FindExternalVisibleDecls (NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl, unsigned int current_id)
 Find all entities matching a given name in a given module, using a NameSearchContext to make Decls for them. More...
 
void FindObjCMethodDecls (NameSearchContext &context)
 Find all Objective-C methods matching a given selector. More...
 
void FindObjCPropertyAndIvarDecls (NameSearchContext &context)
 Find all Objective-C properties and ivars with a given name. More...
 
CompilerType GuardedCopyType (const CompilerType &src_type)
 A wrapper for ClangASTContext::CopyType that sets a flag that indicates that we should not respond to queries during import. More...
 
bool FindObjCMethodDeclsWithOrigin (unsigned int current_id, NameSearchContext &context, clang::ObjCInterfaceDecl *original_interface_decl, const char *log_info)
 
- Protected Attributes inherited from lldb_private::ClangASTSource
bool m_import_in_progress
 
bool m_lookups_enabled
 
const lldb::TargetSP m_target
 The target to use in finding variables and types. More...
 
clang::ASTContext * m_ast_context
 The AST context requests are coming in for. More...
 
clang::FileManager * m_file_manager
 The file manager paired with the AST context. More...
 
lldb::ClangASTImporterSP m_ast_importer_sp
 The target's AST importer. More...
 
std::unique_ptr< clang::ExternalASTMerger > m_merger_up
 The ExternalASTMerger for this parse. More...
 
std::set< const clang::Decl * > m_active_lexical_decls
 
std::set< const char * > m_active_lookups
 

Detailed Description

"lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are defined in LLDB's debug information.

The Clang parser uses the ClangASTSource as an interface to request named entities from outside an expression. The ClangASTSource reports back, listing all possible objects corresponding to a particular name. But it in turn relies on ClangExpressionDeclMap, which performs several important functions.

First, it records what variables and functions were looked up and what Decls were returned for them.

Second, it constructs a struct on behalf of IRForTarget, recording which variables should be placed where and relaying this information back so that IRForTarget can generate context-independent code.

Third, it "materializes" this struct on behalf of the expression command, finding the current values of each variable and placing them into the struct so that it can be passed to the JITted version of the IR.

Fourth and finally, it "dematerializes" the struct after the JITted code has has executed, placing the new values back where it found the old ones.

Definition at line 55 of file ClangExpressionDeclMap.h.

Constructor & Destructor Documentation

◆ ClangExpressionDeclMap()

ClangExpressionDeclMap::ClangExpressionDeclMap ( bool  keep_result_in_memory,
Materializer::PersistentVariableDelegate result_delegate,
ExecutionContext exe_ctx,
ValueObject ctx_obj 
)

Constructor.

Initializes class variables.

Parameters
[in]keep_result_in_memoryIf true, inhibits the normal deallocation of the memory for the result persistent variable, and instead marks the variable as persisting.
[in]delegateIf non-NULL, use this delegate to report result values. This allows the client ClangUserExpression to report a result.
[in]exe_ctxThe execution context to use when parsing.
[in]ctx_objIf not empty, then expression is evaluated in context of this object. See the comment to UserExpression::Evaluate for details.

Definition at line 65 of file ClangExpressionDeclMap.cpp.

◆ ~ClangExpressionDeclMap()

ClangExpressionDeclMap::~ClangExpressionDeclMap ( )
override

Destructor.

Definition at line 76 of file ClangExpressionDeclMap.cpp.

References DidParse().

Member Function Documentation

◆ AddPersistentVariable()

bool ClangExpressionDeclMap::AddPersistentVariable ( const clang::NamedDecl *  decl,
ConstString  name,
TypeFromParser  type,
bool  is_result,
bool  is_lvalue 
)

[Used by IRForTarget] Add a variable to the list of persistent variables for the process.

Parameters
[in]declThe Clang declaration for the persistent variable, used for lookup during parsing.
[in]nameThe name of the persistent variable, usually $something.
[in]typeThe type of the variable, in the Clang parser's context.
Returns
True on success; false otherwise.

Definition at line 311 of file ClangExpressionDeclMap.cpp.

References lldb_private::ClangExpressionVariable::EnableJITVars(), lldb_private::ClangExpressionVariable::EnableParserVars(), lldb_private::ExpressionVariable::EVIsLLDBAllocated, lldb_private::ExpressionVariable::EVIsProgramReference, lldb_private::ExpressionVariable::EVKeepInTarget, lldb_private::ExpressionVariable::EVNeedsAllocation, lldb_private::ExpressionVariable::EVNeedsFreezeDry, lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::ClangExpressionVariable::GetJITVars(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::Target::GetScratchClangASTContext(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::CompilerType::GetTypeSystem(), LIBLLDB_LOG_EXPRESSIONS, lldb_private::ExpressionVariable::m_flags, lldb_private::ExpressionVariable::m_frozen_sp, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, lldb_private::ClangExpressionVariable::JITVars::m_offset, lldb_private::ClangExpressionVariable::ParserVars::m_parser_type, and lldb_private::Log::Printf().

Referenced by IsObjCClassReference(), and IRForTarget::~IRForTarget().

◆ AddValueToStruct()

bool ClangExpressionDeclMap::AddValueToStruct ( const clang::NamedDecl *  decl,
ConstString  name,
llvm::Value *  value,
size_t  size,
lldb::offset_t  alignment 
)

[Used by IRForTarget] Add a variable to the struct that needs to be materialized each time the expression runs.

Parameters
[in]declThe Clang declaration for the variable.
[in]nameThe name of the variable.
[in]valueThe LLVM IR value for this variable.
[in]sizeThe size of the variable in bytes.
[in]alignmentThe required alignment of the variable in bytes.
Returns
True on success; false otherwise.

Definition at line 426 of file ClangExpressionDeclMap.cpp.

References lldb_private::ClangExpressionVariable::FindVariableInList(), lldb_private::ConstString::GetCString(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ExpressionVariable::GetName(), lldb_private::ExpressionVariable::GetRegisterInfo(), LIBLLDB_LOG_EXPRESSIONS, lldb_private::ClangExpressionVariable::JITVars::m_alignment, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_sym, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_var, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::Log::Printf(), and lldb_private::Status::Success().

Referenced by IsObjCClassReference().

◆ DidParse()

void ClangExpressionDeclMap::DidParse ( )

◆ DoStructLayout()

bool ClangExpressionDeclMap::DoStructLayout ( )

[Used by IRForTarget] Finalize the struct, laying out the position of each object in it.

Returns
True on success; false otherwise.

Definition at line 519 of file ClangExpressionDeclMap.cpp.

Referenced by ExciseGuardStore().

◆ FindExternalVisibleDecls() [1/2]

void ClangExpressionDeclMap::FindExternalVisibleDecls ( NameSearchContext context)
overridevirtual

◆ FindExternalVisibleDecls() [2/2]

void ClangExpressionDeclMap::FindExternalVisibleDecls ( NameSearchContext context,
lldb::ModuleSP  module,
CompilerDeclContext namespace_decl,
unsigned int  current_id 
)

Find all entities matching a given name in a given module/namespace, using a NameSearchContext to make Decls for them.

Parameters
[in]contextThe NameSearchContext that can construct Decls for this name.
[in]moduleIf non-NULL, the module to query.
[in]namespace_declIf valid and module is non-NULL, the parent namespace.
[in]current_idThe ID for the current FindExternalVisibleDecls invocation, for logging purposes.
Returns
True on success; false otherwise.

Definition at line 849 of file ClangExpressionDeclMap.cpp.

References lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::NameSearchContext::AddVarDecl(), lldb_private::SymbolContextList::Append(), lldb_private::Status::AsCString(), lldb_private::ConstString::AsCString(), lldb_private::SymbolContext::block, lldb_private::CompilerType::Clear(), lldb_private::ClangASTSource::CompleteType(), lldb_private::ClangASTSource::CopyDecl(), lldb_private::ClangASTContext::CountDeclLevels(), lldb_private::ValueObjectVariable::Create(), lldb_private::ClangASTContext::DeclContextGetAsCXXMethodDecl(), lldb_private::ClangASTContext::DeclContextGetAsObjCMethodDecl(), lldb::eBasicTypeVoid, lldb_private::Value::eContextTypeInvalid, lldb::eSymbolTypeReExported, lldb_private::Value::eValueTypeFileAddress, lldb_private::Value::eValueTypeHostAddress, lldb_private::Value::eValueTypeLoadAddress, lldb_private::ExpressionVariable::EVTypeIsReference, lldb_private::Status::Fail(), lldb_private::CompilerDeclContext::FindDeclByName(), lldb_private::ModuleList::FindFunctions(), lldb_private::VariableList::FindVariable(), lldb_private::SymbolContext::function, lldb_private::NameSearchContext::function, lldb_private::NameSearchContext::function_with_type_info, lldb_private::Symbol::GetAddress(), lldb_private::ClangASTContext::GetASTContext(), lldb_private::ClangASTContext::getASTContext(), lldb_private::ClangASTContext::GetBasicType(), lldb_private::DataExtractor::GetByteSize(), lldb_private::Target::GetClangModulesDeclVendor(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::Value::GetContextType(), lldb_private::ASTDumper::GetCString(), lldb_private::ConstString::GetCString(), lldb_private::DataExtractor::GetDataStart(), lldb_private::Block::GetDeclContext(), lldb_private::Function::GetDeclContext(), lldb_private::DWARFExpression::GetExpressionData(), lldb_private::Type::GetForwardCompilerType(), lldb_private::Type::GetFullCompilerType(), lldb_private::SymbolContext::GetFunctionBlock(), lldb_private::Target::GetImages(), lldb_private::StackFrame::GetInScopeVariableList(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::CompilerType::GetLValueReferenceType(), lldb_private::CompilerDeclContext::GetName(), lldb_private::CompilerDeclContext::GetOpaqueDeclContext(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::CompilerType::GetPointeeType(), lldb_private::Value::GetScalar(), lldb_private::Target::GetScratchClangASTContext(), lldb_private::SymbolContextList::GetSize(), lldb_private::ConstString::GetStringRef(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::Symbol::GetType(), lldb_private::CompilerDeclContext::GetTypeSystem(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::ClangASTContext::GetUniqueNamespaceDeclaration(), lldb_private::Value::GetValueType(), lldb_private::StackFrame::GetVariableList(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::ClangASTSource::IgnoreName(), lldb_private::CompilerDeclContext::IsClassMethod(), lldb_private::Symbol::IsExternal(), lldb_private::ClangASTContext::IsObjCClassType(), lldb_private::ClangASTContext::IsObjCObjectPointerType(), lldb_private::CompilerType::IsReferenceType(), lldb_private::CompilerDeclContext::IsValid(), lldb_private::CompilerType::IsValid(), LIBLLDB_LOG_EXPRESSIONS, LLDB_INVALID_ADDRESS, LLDB_INVALID_DECL_LEVEL, lldb_private::NameSearchContext::local_vars_nsp, lldb_private::ClangASTSource::m_ast_context, lldb_private::NameSearchContext::m_decl_name, lldb_private::NameSearchContext::m_found, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_sym, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_var, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, lldb_private::ClangExpressionVariable::ParserVars::m_parser_type, lldb_private::ClangASTSource::m_target, lldb_private::SymbolContext::module_sp, lldb_private::Log::Printf(), lldb_private::Log::PutCString(), lldb_private::Symbol::ResolveReExportedSymbol(), lldb_private::Value::SetCompilerType(), lldb_private::Value::SetValueType(), lldb_private::Status::Success(), lldb_private::SymbolContext::symbol, UINT32_MAX, lldb_private::Scalar::ULongLong(), and lldb_private::NameSearchContext::variable.

◆ GetFunctionInfo()

bool ClangExpressionDeclMap::GetFunctionInfo ( const clang::NamedDecl *  decl,
uint64_t &  ptr 
)

[Used by IRForTarget] Get information about a function given its Decl.

Parameters
[in]declThe parsed Decl for the Function, as generated by ClangASTSource on ClangExpressionDeclMap's behalf.
[out]ptrThe absolute address of the function in the target.
Returns
True if the information could be retrieved; false otherwise.

Definition at line 586 of file ClangExpressionDeclMap.cpp.

References lldb_private::ClangExpressionVariable::FindVariableInList(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::Value::GetScalar(), lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, and lldb_private::Scalar::ULongLong().

◆ GetStructElement()

bool ClangExpressionDeclMap::GetStructElement ( const clang::NamedDecl *&  decl,
llvm::Value *&  value,
lldb::offset_t offset,
ConstString name,
uint32_t  index 
)

[Used by IRForTarget] Get specific information about one field of the laid-out struct after DoStructLayout() has been called.

Parameters
[out]declThe parsed Decl for the field, as generated by ClangASTSource on ClangExpressionDeclMap's behalf. In the case of the result value, this will have the name $__lldb_result even if the result value ends up having the name $1. This is an implementation detail of IRForTarget.
[out]valueThe IR value for the field (usually a GlobalVariable). In the case of the result value, this will have the correct name ($1, for instance). This is an implementation detail of IRForTarget.
[out]offsetThe offset of the field from the beginning of the struct. As long as the struct is aligned according to its required alignment, this offset will align the field correctly.
[out]nameThe name of the field as used in materialization.
[in]indexThe index of the field about which information is requested.
Returns
True if the information could be retrieved; false otherwise.

Definition at line 550 of file ClangExpressionDeclMap.cpp.

References lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, and lldb_private::ClangExpressionVariable::ParserVars::m_named_decl.

Referenced by ExciseGuardStore().

◆ GetStructInfo()

bool ClangExpressionDeclMap::GetStructInfo ( uint32_t num_elements,
size_t &  size,
lldb::offset_t alignment 
)

[Used by IRForTarget] Get general information about the laid-out struct after DoStructLayout() has been called.

Parameters
[out]num_elementsThe number of elements in the struct.
[out]sizeThe size of the struct, in bytes.
[out]alignmentThe alignment of the struct, in bytes.
Returns
True if the information could be retrieved; false otherwise.

Definition at line 536 of file ClangExpressionDeclMap.cpp.

Referenced by ExciseGuardStore().

◆ GetSymbolAddress() [1/2]

addr_t ClangExpressionDeclMap::GetSymbolAddress ( Target target,
Process process,
ConstString  name,
lldb::SymbolType  symbol_type,
lldb_private::Module module = NULL 
)

[Used by IRForTarget] Get the address of a symbol given nothing but its name.

Parameters
[in]targetThe target to find the symbol in. If not provided, then the current parsing context's Target.
[in]processThe process to use. For Objective-C symbols, the process's Objective-C language runtime may be queried if the process is non-NULL.
[in]nameThe name of the symbol.
[in]moduleThe module to limit the search to. This can be NULL
Returns
Valid load address for the symbol

Definition at line 605 of file ClangExpressionDeclMap.cpp.

References lldb_private::ConstString::Clear(), lldb::eSymbolTypeAbsolute, lldb::eSymbolTypeAdditional, lldb::eSymbolTypeBlock, lldb::eSymbolTypeCode, lldb::eSymbolTypeCommonBlock, lldb::eSymbolTypeCompiler, lldb::eSymbolTypeData, lldb::eSymbolTypeException, lldb::eSymbolTypeHeaderFile, lldb::eSymbolTypeInstrumentation, lldb::eSymbolTypeInvalid, lldb::eSymbolTypeLineEntry, lldb::eSymbolTypeLineHeader, lldb::eSymbolTypeLocal, lldb::eSymbolTypeObjCClass, lldb::eSymbolTypeObjCIVar, lldb::eSymbolTypeObjCMetaClass, lldb::eSymbolTypeObjectFile, lldb::eSymbolTypeParam, lldb::eSymbolTypeReExported, lldb::eSymbolTypeResolver, lldb::eSymbolTypeRuntime, lldb::eSymbolTypeScopeBegin, lldb::eSymbolTypeScopeEnd, lldb::eSymbolTypeSourceFile, lldb::eSymbolTypeTrampoline, lldb::eSymbolTypeUndefined, lldb::eSymbolTypeVariable, lldb::eSymbolTypeVariableType, lldb_private::ModuleList::FindFirstModule(), lldb_private::Module::FindSymbolsWithNameAndType(), lldb_private::ModuleList::FindSymbolsWithNameAndType(), lldb_private::Symbol::GetAddress(), lldb_private::Address::GetCallableLoadAddress(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::FileSpec::GetDirectory(), lldb_private::Target::GetImages(), lldb_private::Address::GetLoadAddress(), lldb_private::Process::GetObjCLanguageRuntime(), lldb_private::ModuleSpec::GetPlatformFileSpec(), lldb_private::Symbol::GetReExportedSymbolName(), lldb_private::Symbol::GetReExportedSymbolSharedLibrary(), lldb_private::SymbolContextList::GetSize(), lldb_private::Symbol::GetType(), lldb_private::Address::IsValid(), LLDB_INVALID_ADDRESS, lldb_private::ObjCLanguageRuntime::LookupRuntimeSymbol(), and lldb_private::SymbolContext::symbol.

Referenced by GetSymbolAddress(), and IsObjCClassReference().

◆ GetSymbolAddress() [2/2]

addr_t ClangExpressionDeclMap::GetSymbolAddress ( ConstString  name,
lldb::SymbolType  symbol_type 
)

◆ GetTargetInfo()

ClangExpressionDeclMap::TargetInfo ClangExpressionDeclMap::GetTargetInfo ( )

◆ InstallCodeGenerator()

void ClangExpressionDeclMap::InstallCodeGenerator ( clang::ASTConsumer *  code_gen)

◆ ResolveUnknownTypes()

bool ClangExpressionDeclMap::ResolveUnknownTypes ( )

[Used by ClangExpressionParser] For each variable that had an unknown type at the beginning of parsing, determine its final type now.

Returns
True on success; false otherwise.

Definition at line 1849 of file ClangExpressionDeclMap.cpp.

References lldb_private::NameSearchContext::AddFunDecl(), lldb_private::NameSearchContext::AddGenericFunDecl(), lldb_private::ClangASTContext::AddMethodToCXXRecordType(), lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::NameSearchContext::AddTypeDecl(), lldb_private::NameSearchContext::AddVarDecl(), lldb_private::ConstString::AsCString(), lldb_private::Value::Clear(), lldb_private::ClangASTSource::CopyDecl(), lldb_private::ClangASTSource::CopyTypeWithMerger(), lldb_private::ClangASTContext::CreateFunctionType(), lldb_private::Address::Dump(), lldb_private::Address::DumpStyleResolvedDescription, lldb::eAccessPublic, lldb::eBasicTypeVoid, lldb_private::ClangExpressionVariable::EnableParserVars(), lldb_private::Value::eValueTypeFileAddress, lldb_private::Value::eValueTypeLoadAddress, lldb_private::ExpressionVariable::EVBareRegister, lldb_private::ExpressionVariable::EVUnknownType, lldb_private::Symbol::GetAddress(), lldb_private::ClangASTContext::GetASTContext(), lldb_private::ClangASTContext::getASTContext(), lldb_private::ClangASTContext::GetBasicType(), lldb_private::ClangASTContext::GetBuiltinTypeForEncodingAndBitSize(), lldb_private::Address::GetCallableLoadAddress(), lldb_private::CompilerType::GetCompleteType(), lldb_private::ASTDumper::GetCString(), lldb_private::ConstString::GetCString(), lldb_private::StreamString::GetData(), lldb_private::Address::GetFileAddress(), lldb_private::Type::GetFullCompilerType(), lldb_private::UserID::GetID(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ClangASTContextForExpressions::GetMergerUnchecked(), lldb_private::Type::GetName(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::CompilerType::GetPointerType(), lldb_private::Value::GetScalar(), lldb_private::Target::GetScratchClangASTContext(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::ClangASTSource::HasMerger(), lldb_private::CompilerType::IsAggregateType(), lldb_private::CPlusPlusLanguage::IsCPPMangledName(), lldb_private::Symbol::IsIndirect(), lldb_private::CompilerType::IsValid(), lldb_private::Language::LanguageIsC(), lldb_private::Language::LanguageIsCPlusPlus(), lldb_private::Language::LanguageIsObjC(), LIBLLDB_LOG_EXPRESSIONS, LLDB_INVALID_ADDRESS, lldbassert, lldb_private::ClangASTSource::m_ast_context, lldb_private::ClangASTSource::m_ast_importer_sp, lldb_private::NameSearchContext::m_decl_name, lldb_private::ExpressionVariable::m_flags, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, lldb_private::ClangExpressionVariable::ParserVars::m_parser_type, lldb_private::Log::Printf(), lldb_private::Stream::Printf(), lldb_private::ExpressionVariable::SetCompilerType(), lldb_private::Value::SetCompilerType(), lldb_private::CompilerType::SetCompilerType(), lldb_private::ExpressionVariable::SetName(), lldb_private::ExpressionVariable::SetRegisterInfo(), and lldb_private::Value::SetValueType().

Referenced by lldb_private::ClangExpressionParser::Parse().

◆ WillParse()

bool ClangExpressionDeclMap::WillParse ( ExecutionContext exe_ctx,
Materializer materializer 
)

Enable the state needed for parsing and IR transformation.

Parameters
[in]exe_ctxThe execution context to use when finding types for variables. Also used to find a "scratch" AST context to store result types.
[in]materializerIf non-NULL, the materializer to populate with information about the variables to use
Returns
True if parsing is possible; false if it is unsafe to continue.

Definition at line 85 of file ClangExpressionDeclMap.cpp.

References lldb_private::ClangASTMetrics::ClearLocalCounters(), lldb::eLanguageTypeC, lldb_private::ExecutionContext::GetFramePtr(), lldb_private::Target::GetPersistentExpressionStateForLanguage(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Target::GetScratchClangASTContext(), lldb_private::Thread::GetStackFrameAtIndex(), lldb_private::StackFrame::GetSymbolContext(), GetTargetInfo(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::ExecutionContext::GetTargetSP(), and lldb_private::ExecutionContext::GetThreadPtr().

Referenced by lldb_private::ClangUserExpression::Complete(), and lldb_private::ClangUserExpression::Parse().


The documentation for this class was generated from the following files: