LLDB mainline
|
"lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are defined in LLDB's debug information. More...
#include <ClangExpressionDeclMap.h>
Classes | |
class | ParserVars |
The following values should not live beyond parsing. More... | |
struct | StructVars |
The following values contain layout information for the materialized struct, but are not specific to a single materialization. More... | |
struct | TargetInfo |
Public Member Functions | |
ClangExpressionDeclMap (bool keep_result_in_memory, Materializer::PersistentVariableDelegate *result_delegate, const lldb::TargetSP &target, const std::shared_ptr< ClangASTImporter > &importer, ValueObject *ctx_obj) | |
Constructor. | |
~ClangExpressionDeclMap () override | |
Destructor. | |
bool | WillParse (ExecutionContext &exe_ctx, Materializer *materializer) |
Enable the state needed for parsing and IR transformation. | |
void | InstallCodeGenerator (clang::ASTConsumer *code_gen) |
void | InstallDiagnosticManager (DiagnosticManager &diag_manager) |
void | DidParse () |
Disable the state needed for parsing and IR transformation. | |
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. | |
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. | |
bool | DoStructLayout () |
[Used by IRForTarget] Finalize the struct, laying out the position of each object in it. | |
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. | |
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. | |
bool | GetFunctionInfo (const clang::NamedDecl *decl, uint64_t &ptr) |
[Used by IRForTarget] Get information about a function given its Decl. | |
lldb::addr_t | GetSymbolAddress (Target &target, Process *process, ConstString name, lldb::SymbolType symbol_type, Module *module=nullptr) |
[Used by IRForTarget] Get the address of a symbol given nothing but its name. | |
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. | |
void | FindExternalVisibleDecls (NameSearchContext &context, lldb::ModuleSP module, const CompilerDeclContext &namespace_decl) |
Find all entities matching a given name in a given module/namespace, using a NameSearchContext to make Decls for them. | |
Public Member Functions inherited from lldb_private::ClangASTSource | |
ClangASTSource (const lldb::TargetSP &target, const std::shared_ptr< ClangASTImporter > &importer) | |
Constructor. | |
~ClangASTSource () override | |
Destructor. | |
clang::Decl * | GetExternalDecl (clang::GlobalDeclID) override |
Interface stubs. | |
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 (TypeSystemClang &ast_context) |
bool | FindExternalVisibleDeclsByName (const clang::DeclContext *DC, clang::DeclarationName Name) override |
Look up all Decls that match a particular name. | |
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. | |
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. | |
void | CompleteType (clang::TagDecl *Tag) override |
Complete a TagDecl. | |
void | CompleteType (clang::ObjCInterfaceDecl *Class) override |
Complete an ObjCInterfaceDecl. | |
void | StartTranslationUnit (clang::ASTConsumer *Consumer) override |
Called on entering a translation unit. | |
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. | |
clang::NamespaceDecl * | AddNamespace (NameSearchContext &context, ClangASTImporter::NamespaceMapSP &namespace_decls) |
virtual void | FindExternalVisibleDecls (NameSearchContext &context) |
The worker function for FindExternalVisibleDeclsByName. | |
clang::Sema * | getSema () |
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. | |
clang::Decl * | CopyDecl (clang::Decl *src_decl) |
Copies a single Decl into the parser's AST context. | |
ClangASTImporter::DeclOrigin | GetDeclOrigin (const clang::Decl *decl) |
Determined the origin of a single Decl, if it can be found. | |
TypeSystemClang * | GetTypeSystem () const |
Returns the TypeSystem that uses this ClangASTSource instance as it's ExternalASTSource. | |
Public Member Functions inherited from lldb_private::ClangASTImporter::MapCompleter | |
virtual | ~MapCompleter () |
virtual void | CompleteNamespaceMap (NamespaceMapSP &namespace_map, ConstString name, NamespaceMapSP &parent_map) const =0 |
Protected Member Functions | |
virtual clang::NamedDecl * | GetPersistentDecl (ConstString name) |
Retrieves the declaration with the given name from the storage of persistent declarations. | |
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. | |
void | FindExternalVisibleDecls (NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl) |
Find all entities matching a given name in a given module, using a NameSearchContext to make Decls for them. | |
void | FindObjCMethodDecls (NameSearchContext &context) |
Find all Objective-C methods matching a given selector. | |
void | FindObjCPropertyAndIvarDecls (NameSearchContext &context) |
Find all Objective-C properties and ivars with a given name. | |
void | LookupInNamespace (NameSearchContext &context) |
Performs lookup into a namespace. | |
CompilerType | GuardedCopyType (const CompilerType &src_type) |
A wrapper for TypeSystemClang::CopyType that sets a flag that indicates that we should not respond to queries during import. | |
std::shared_ptr< ClangModulesDeclVendor > | GetClangModulesDeclVendor () |
bool | FindObjCMethodDeclsWithOrigin (NameSearchContext &context, clang::ObjCInterfaceDecl *original_interface_decl, const char *log_info) |
void | FindDeclInModules (NameSearchContext &context, ConstString name) |
void | FindDeclInObjCRuntime (NameSearchContext &context, ConstString name) |
void | FillNamespaceMap (NameSearchContext &context, lldb::ModuleSP module_sp, const CompilerDeclContext &namespace_decl) |
Fills the namespace map of the given NameSearchContext. | |
clang::TagDecl * | FindCompleteType (const clang::TagDecl *decl) |
Private Member Functions | |
void | EnableParserVars () |
Activate parser-specific variables. | |
void | DisableParserVars () |
Deallocate parser-specific variables. | |
void | EnableStructVars () |
Activate struct variables. | |
void | DisableStructVars () |
Deallocate struct variables. | |
lldb::TypeSystemClangSP | GetScratchContext (Target &target) |
uint64_t | GetParserID () |
Get this parser's ID for use in extracting parser- and JIT-specific data from persistent variables. | |
void | MaybeRegisterFunctionBody (clang::FunctionDecl *copied_function_decl) |
Should be called on all copied functions. | |
void | SearchPersistenDecls (NameSearchContext &context, const ConstString name) |
Searches the persistent decls of the target for entities with the given name. | |
void | LookUpLldbClass (NameSearchContext &context) |
Handles looking up $__lldb_class which requires special treatment. | |
void | LookUpLldbObjCClass (NameSearchContext &context) |
Handles looking up $__lldb_objc_class which requires special treatment. | |
void | LookupLocalVarNamespace (SymbolContext &sym_ctx, NameSearchContext &name_context) |
Handles looking up the synthetic namespace that contains our local variables for the current frame. | |
void | LookupInModulesDeclVendor (NameSearchContext &context, ConstString name) |
Lookup entities in the ClangModulesDeclVendor. | |
bool | LookupLocalVariable (NameSearchContext &context, ConstString name, SymbolContext &sym_ctx, const CompilerDeclContext &namespace_decl) |
Looks up a local variable. | |
SymbolContextList | SearchFunctionsInSymbolContexts (const SymbolContextList &sc_list, const CompilerDeclContext &frame_decl_context) |
Searches for functions in the given SymbolContextList. | |
void | LookupFunction (NameSearchContext &context, lldb::ModuleSP module_sp, ConstString name, const CompilerDeclContext &namespace_decl) |
Looks up a function. | |
lldb::VariableSP | FindGlobalVariable (Target &target, lldb::ModuleSP &module, ConstString name, const CompilerDeclContext &namespace_decl) |
Given a target, find a variable that matches the given name and type. | |
bool | GetVariableValue (lldb::VariableSP &var, lldb_private::Value &var_location, TypeFromUser *found_type=nullptr, TypeFromParser *parser_type=nullptr) |
Get the value of a variable in a given execution context and return the associated Types if needed. | |
ClangExpressionVariable::ParserVars * | AddExpressionVariable (NameSearchContext &context, TypeFromParser const &pt, lldb::ValueObjectSP valobj) |
Use the NameSearchContext to generate a Decl for the given LLDB ValueObject, and put it in the list of found entities. | |
void | AddOneVariable (NameSearchContext &context, lldb::VariableSP var, lldb::ValueObjectSP valobj) |
Use the NameSearchContext to generate a Decl for the given LLDB Variable, and put it in the Tuple list. | |
void | AddOneVariable (NameSearchContext &context, lldb::ValueObjectSP valobj, ValueObjectProviderTy valobj_provider) |
Use the NameSearchContext to generate a Decl for the given ValueObject and put it in the list of found entities. | |
void | AddOneVariable (NameSearchContext &context, lldb::ExpressionVariableSP &pvar_sp) |
Use the NameSearchContext to generate a Decl for the given persistent variable, and put it in the list of found entities. | |
void | AddOneGenericVariable (NameSearchContext &context, const Symbol &symbol) |
Use the NameSearchContext to generate a Decl for the given LLDB symbol (treated as a variable), and put it in the list of found entities. | |
void | AddOneFunction (NameSearchContext &context, Function *fun, Symbol *sym) |
Use the NameSearchContext to generate a Decl for the given function. | |
void | AddOneRegister (NameSearchContext &context, const RegisterInfo *reg_info) |
Use the NameSearchContext to generate a Decl for the given register. | |
void | AddOneType (NameSearchContext &context, const TypeFromUser &type) |
Use the NameSearchContext to generate a Decl for the given type. | |
void | AddContextClassType (NameSearchContext &context, const TypeFromUser &type) |
Adds the class in which the expression is evaluated to the lookup and prepares the class to be used as a context for expression evaluation (for example, it creates a fake member function that will contain the expression LLDB is trying to evaluate). | |
TypeFromUser | DeportType (TypeSystemClang &target, TypeSystemClang &source, TypeFromParser parser_type) |
Move a type out of the current ASTContext into another, but make sure to export all components of the type also. | |
TypeSystemClang * | GetTypeSystemClang () |
Private Attributes | |
ExpressionVariableList | m_found_entities |
All entities that were looked up for the parser. | |
ExpressionVariableList | m_struct_members |
All entities that need to be placed in the struct. | |
bool | m_keep_result_in_memory |
True if result persistent variables generated by this expression should stay in memory. | |
Materializer::PersistentVariableDelegate * | m_result_delegate |
If non-NULL, used to report expression results to ClangUserExpression. | |
ValueObject * | m_ctx_obj |
If not empty, then expression is evaluated in context of this object. | |
std::unique_ptr< ParserVars > | m_parser_vars |
std::unique_ptr< StructVars > | m_struct_vars |
Additional Inherited Members | |
Protected Attributes inherited from lldb_private::ClangASTSource | |
bool | m_lookups_enabled |
const lldb::TargetSP | m_target |
The target to use in finding variables and types. | |
clang::ASTContext * | m_ast_context |
The AST context requests are coming in for. | |
TypeSystemClang * | m_clang_ast_context |
The TypeSystemClang for m_ast_context. | |
clang::FileManager * | m_file_manager |
The file manager paired with the AST context. | |
std::shared_ptr< ClangASTImporter > | m_ast_importer_sp |
The target's AST importer. | |
std::set< const clang::Decl * > | m_active_lexical_decls |
std::set< const char * > | m_active_lookups |
"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 executed, placing the new values back where it found the old ones.
Definition at line 57 of file ClangExpressionDeclMap.h.
ClangExpressionDeclMap::ClangExpressionDeclMap | ( | bool | keep_result_in_memory, |
Materializer::PersistentVariableDelegate * | result_delegate, | ||
const lldb::TargetSP & | target, | ||
const std::shared_ptr< ClangASTImporter > & | importer, | ||
ValueObject * | ctx_obj | ||
) |
Constructor.
Initializes class variables.
[in] | keep_result_in_memory | If true, inhibits the normal deallocation of the memory for the result persistent variable, and instead marks the variable as persisting. |
[in] | result_delegate | If non-NULL, use this delegate to report result values. This allows the client ClangUserExpression to report a result. |
[in] | target | The target to use when parsing. |
[in] | importer | The ClangASTImporter to use when parsing. |
[in] | ctx_obj | If not empty, then expression is evaluated in context of this object. See the comment to UserExpression::Evaluate for details. |
Definition at line 86 of file ClangExpressionDeclMap.cpp.
References EnableStructVars().
|
override |
Destructor.
Definition at line 98 of file ClangExpressionDeclMap.cpp.
References DidParse(), and DisableStructVars().
|
private |
Adds the class in which the expression is evaluated to the lookup and prepares the class to be used as a context for expression evaluation (for example, it creates a fake member function that will contain the expression LLDB is trying to evaluate).
[in] | context | The NameSearchContext to which the class should be added as a lookup result. |
[in] | type | The type of the class that serves as the evaluation context. |
Definition at line 1965 of file ClangExpressionDeclMap.cpp.
References lldb_private::TypeSystemClang::AddMethodToCXXRecordType(), lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::TypeSystemClang::CreateFunctionType(), lldb_private::ClangUtil::DumpDecl(), lldb::eAccessPublic, lldb::eBasicTypeVoid, lldb_private::Expressions, lldb_private::TypeSystemClang::GetBasicType(), lldb_private::CompilerType::GetCompleteType(), lldb_private::GetLog(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::CompilerType::GetPointerType(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::CompilerType::IsAggregateType(), lldb_private::CompilerType::IsValid(), LLDB_LOG, lldb_private::ClangASTSource::m_ast_context, lldb_private::ClangASTSource::m_clang_ast_context, lldb_private::NameSearchContext::m_decl_name, and lldb_private::ClangUtil::ToString().
Referenced by LookUpLldbClass().
|
private |
Use the NameSearchContext to generate a Decl for the given LLDB ValueObject, and put it in the list of found entities.
Helper function used by the other AddOneVariable APIs.
[in,out] | context | The NameSearchContext to use when constructing the Decl. |
[in] | pt | The CompilerType of the variable we're adding a Decl for. |
[in] | var | The LLDB ValueObject that needs a Decl. |
Definition at line 1553 of file ClangExpressionDeclMap.cpp.
References lldb_private::ExpressionVariableList::AddNewlyConstructedVariable(), lldb_private::NameSearchContext::AddVarDecl(), lldb_private::ClangASTSource::CompleteType(), lldb_private::ClangExpressionVariable::EnableParserVars(), GetParserID(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::NameSearchContext::m_decl_name, m_found_entities, and lldb_private::ClangExpressionVariable::ParserVars::m_named_decl.
Referenced by AddOneVariable().
|
private |
Use the NameSearchContext to generate a Decl for the given function.
(Functions are not placed in the Tuple list.) Can handle both fully typed functions and generic functions.
[in] | context | The NameSearchContext to use when constructing the Decl. |
[in] | fun | The Function that needs to be created. If non-NULL, this is a fully-typed function. |
[in] | sym | The Symbol that corresponds to a function that needs to be created with generic type (unitptr_t foo(...)). |
Definition at line 1794 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddFunDecl(), lldb_private::NameSearchContext::AddGenericFunDecl(), lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::ExpressionVariableList::AddNewlyConstructedVariable(), lldb_private::ConstString::AsCString(), lldb_private::ClangASTSource::CopyDecl(), lldb_private::Address::Dump(), lldb_private::ClangUtil::DumpDecl(), lldb_private::Address::DumpStyleResolvedDescription, lldb_private::Function::DumpSymbolContext(), lldb_private::ClangExpressionVariable::EnableParserVars(), lldb_private::Expressions, lldb_private::Value::FileAddress, lldb_private::Symbol::GetAddress(), lldb_private::Function::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetCallableLoadAddress(), lldb_private::Function::GetCompileUnit(), lldb_private::StreamString::GetData(), lldb_private::Function::GetDeclContext(), lldb_private::Address::GetFileAddress(), lldb_private::Type::GetFullCompilerType(), lldb_private::UserID::GetID(), lldb_private::CompileUnit::GetLanguage(), lldb_private::GetLog(), lldb_private::Function::GetMangled(), lldb_private::Mangled::GetMangledName(), lldb_private::Type::GetName(), lldb_private::CompilerDeclContext::GetOpaqueDeclContext(), GetParserID(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::Value::GetScalar(), lldb_private::Function::GetType(), lldb_private::CompilerDeclContext::GetTypeSystem(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::CPlusPlusLanguage::IsCPPMangledName(), lldb_private::Symbol::IsIndirect(), lldb_private::Language::LanguageIsC(), lldb_private::Language::LanguageIsCPlusPlus(), lldb_private::Language::LanguageIsObjC(), LLDB_INVALID_ADDRESS, LLDB_LOG, lldb_private::Value::LoadAddress, lldb_private::NameSearchContext::m_decl_name, m_found_entities, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, m_parser_vars, and lldb_private::Value::SetValueType().
Referenced by LookupFunction().
|
private |
Use the NameSearchContext to generate a Decl for the given LLDB symbol (treated as a variable), and put it in the list of found entities.
Definition at line 1703 of file ClangExpressionDeclMap.cpp.
References lldb_private::ExpressionVariableList::AddNewlyConstructedVariable(), lldb_private::NameSearchContext::AddVarDecl(), lldb_private::ClangUtil::DumpDecl(), lldb::eBasicTypeVoid, lldb_private::ClangExpressionVariable::EnableParserVars(), lldb_private::Expressions, lldb_private::Symbol::GetAddress(), lldb_private::TypeSystemClang::GetBasicType(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLog(), lldb_private::CompilerType::GetLValueReferenceType(), GetParserID(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::CompilerType::GetPointerType(), lldb_private::Value::GetScalar(), GetScratchContext(), LLDB_LOG, lldb_private::Value::LoadAddress, lldb_private::ClangASTSource::m_clang_ast_context, lldb_private::NameSearchContext::m_decl_name, m_found_entities, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_sym, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, m_parser_vars, lldb_private::Value::SetCompilerType(), and lldb_private::Value::SetValueType().
Referenced by FindExternalVisibleDecls().
|
private |
Use the NameSearchContext to generate a Decl for the given register.
[in] | context | The NameSearchContext to use when constructing the Decl. |
[in] | reg_info | The information corresponding to that register. |
Definition at line 1755 of file ClangExpressionDeclMap.cpp.
References lldb_private::ExpressionVariableList::AddNewlyConstructedVariable(), lldb_private::NameSearchContext::AddVarDecl(), lldb_private::RegisterInfo::byte_size, lldb_private::Value::Clear(), lldb_private::ClangUtil::DumpDecl(), lldb_private::ClangExpressionVariable::EnableParserVars(), lldb_private::RegisterInfo::encoding, lldb_private::Expressions, lldb_private::TypeSystemClang::GetBuiltinTypeForEncodingAndBitSize(), lldb_private::GetLog(), GetParserID(), lldb_private::ClangExpressionVariable::GetParserVars(), LLDB_LOG, lldb_private::ClangASTSource::m_clang_ast_context, lldb_private::NameSearchContext::m_decl_name, m_found_entities, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, and m_parser_vars.
Referenced by FindExternalVisibleDecls().
|
private |
Use the NameSearchContext to generate a Decl for the given type.
(Types are not placed in the Tuple list.)
[in] | context | The NameSearchContext to use when constructing the Decl. |
[in] | type | The type that needs to be created. |
Definition at line 2030 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddTypeDecl(), lldb_private::Expressions, lldb_private::GetLog(), lldb_private::ClangASTSource::GuardedCopyType(), and LLDB_LOG.
Referenced by LookUpLldbObjCClass().
|
private |
Use the NameSearchContext to generate a Decl for the given persistent variable, and put it in the list of found entities.
[in] | context | The NameSearchContext to use when constructing the Decl. |
[in] | pvar_sp | The persistent variable that needs a Decl. |
Definition at line 1672 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddVarDecl(), lldb_private::Value::Clear(), lldb_private::ClangUtil::DumpDecl(), lldb_private::Expressions, lldb_private::GetLog(), GetParserID(), lldb_private::ClangASTSource::GuardedCopyType(), LLDB_LOG, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, and lldb_private::ClangExpressionVariable::ParserVars::m_named_decl.
|
private |
Use the NameSearchContext to generate a Decl for the given ValueObject and put it in the list of found entities.
[in,out] | context | The NameSearchContext to use when constructing the Decl. |
[in] | valobj | The ValueObject that needs a Decl. |
[in] | valobj_provider | Callback that fetches a ValueObjectSP from the specified frame |
Definition at line 1596 of file ClangExpressionDeclMap.cpp.
References AddExpressionVariable(), lldb_private::ClangUtil::DumpDecl(), lldb_private::CompilerType::TypeSystemSPWrapper::dyn_cast_or_null(), lldb_private::Expressions, lldb_private::Value::GetContextType(), lldb_private::GetLog(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::Value::Invalid, LLDB_LOG, lldb_private::NameSearchContext::m_decl_name, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_valobj_provider, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, m_parser_vars, lldb_private::Value::SetCompilerType(), and lldb_private::ClangUtil::ToString().
|
private |
Use the NameSearchContext to generate a Decl for the given LLDB Variable, and put it in the Tuple list.
[in] | context | The NameSearchContext to use when constructing the Decl. |
[in] | var | The LLDB Variable that needs a Decl. |
[in] | valobj | The LLDB ValueObject for that variable. |
Definition at line 1643 of file ClangExpressionDeclMap.cpp.
References AddExpressionVariable(), lldb_private::ClangUtil::DumpDecl(), lldb_private::Expressions, lldb_private::GetLog(), GetVariableValue(), LLDB_LOG, lldb_private::NameSearchContext::m_decl_name, 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, m_parser_vars, and lldb_private::ClangUtil::ToString().
Referenced by FindExternalVisibleDecls(), and LookupLocalVariable().
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.
[in] | decl | The Clang declaration for the persistent variable, used for lookup during parsing. |
[in] | name | The name of the persistent variable, usually $something. |
[in] | type | The type of the variable, in the Clang parser's context. |
Definition at line 215 of file ClangExpressionDeclMap.cpp.
References lldb_private::ExpressionVariableList::AddNewlyConstructedVariable(), DeportType(), lldb_private::eDiagnosticOriginLLDB, lldb_private::ClangExpressionVariable::EnableJITVars(), lldb_private::ClangExpressionVariable::EnableParserVars(), lldb::eSeverityError, lldb_private::Expressions, lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::ClangExpressionVariable::GetJITVars(), lldb_private::GetLog(), lldb_private::CompilerType::GetOpaqueQualType(), GetParserID(), lldb_private::ClangExpressionVariable::GetParserVars(), GetScratchContext(), lldb_private::ExecutionContext::GetTargetPtr(), LLDB_LOG, m_found_entities, m_keep_result_in_memory, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, lldb_private::ClangExpressionVariable::JITVars::m_offset, m_parser_vars, and m_result_delegate.
Referenced by IRForTarget::CreateResultVariable(), and IRForTarget::RewritePersistentAlloc().
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.
[in] | decl | The Clang declaration for the variable. |
[in] | name | The name of the variable. |
[in] | value | The LLVM IR value for this variable. |
[in] | size | The size of the variable in bytes. |
[in] | alignment | The required alignment of the variable in bytes. |
Definition at line 342 of file ClangExpressionDeclMap.cpp.
References lldb_private::ExpressionVariableList::AddVariable(), lldb_private::Expressions, lldb_private::ClangExpressionVariable::FindVariableInList(), lldb_private::GetLog(), GetParserID(), LLDB_LOG, lldb_private::ClangExpressionVariable::JITVars::m_alignment, m_found_entities, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_sym, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_valobj_provider, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_var, lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::JITVars::m_offset, m_parser_vars, lldb_private::ClangExpressionVariable::JITVars::m_size, m_struct_members, m_struct_vars, and lldb_private::Status::Success().
Referenced by IRForTarget::MaybeHandleVariable().
|
private |
Move a type out of the current ASTContext into another, but make sure to export all components of the type also.
[in] | target | The TypeSystemClang to move to. |
[in] | source | The TypeSystemClang to move from. This is assumed to be going away. |
[in] | parser_type | The type as it appears in the source context. |
Definition at line 204 of file ClangExpressionDeclMap.cpp.
References lldb_private::TypeSystemClang::getASTContext(), GetScratchContext(), lldb_private::ClangASTSource::m_ast_context, and lldb_private::ClangASTSource::m_ast_importer_sp.
Referenced by AddPersistentVariable().
void ClangExpressionDeclMap::DidParse | ( | ) |
Disable the state needed for parsing and IR transformation.
Definition at line 155 of file ClangExpressionDeclMap.cpp.
References DisableParserVars(), GetParserID(), lldb_private::ExpressionVariableList::GetSize(), lldb_private::ExpressionVariableList::GetVariableAtIndex(), m_found_entities, and m_parser_vars.
Referenced by lldb_private::ClangUtilityFunction::Install(), and ~ClangExpressionDeclMap().
|
inlineprivate |
Deallocate parser-specific variables.
Definition at line 352 of file ClangExpressionDeclMap.h.
References m_parser_vars.
Referenced by DidParse().
|
inlineprivate |
Deallocate struct variables.
Definition at line 379 of file ClangExpressionDeclMap.h.
References m_struct_vars.
Referenced by ~ClangExpressionDeclMap().
bool ClangExpressionDeclMap::DoStructLayout | ( | ) |
[Used by IRForTarget] Finalize the struct, laying out the position of each object in it.
Definition at line 434 of file ClangExpressionDeclMap.cpp.
References m_parser_vars, and m_struct_vars.
Referenced by IRForTarget::ReplaceVariables().
|
inlineprivate |
Activate parser-specific variables.
Definition at line 346 of file ClangExpressionDeclMap.h.
References m_parser_vars.
Referenced by WillParse().
|
inlineprivate |
Activate struct variables.
Definition at line 373 of file ClangExpressionDeclMap.h.
References m_struct_vars.
Referenced by ClangExpressionDeclMap().
|
overridevirtual |
[Used by ClangASTSource] Find all entities matching a given name, using a NameSearchContext to make Decls for them.
[in] | context | The NameSearchContext that can construct Decls for this name. |
Reimplemented from lldb_private::ClangASTSource.
Definition at line 663 of file ClangExpressionDeclMap.cpp.
References lldb_private::TypeSystemClang::CreateDeclContext(), lldb_private::Expressions, lldb_private::ClangASTSource::FindExternalVisibleDecls(), FindExternalVisibleDecls(), g_lldb_local_vars_namespace_cstr, lldb_private::GetLog(), LLDB_LOG, LLDB_LOGV, lldb_private::ClangASTSource::m_ast_context, lldb_private::ClangASTSource::m_ast_importer_sp, lldb_private::ClangASTSource::m_clang_ast_context, lldb_private::NameSearchContext::m_decl_context, and lldb_private::NameSearchContext::m_decl_name.
Referenced by FindExternalVisibleDecls().
void ClangExpressionDeclMap::FindExternalVisibleDecls | ( | NameSearchContext & | context, |
lldb::ModuleSP | module, | ||
const CompilerDeclContext & | namespace_decl | ||
) |
Find all entities matching a given name in a given module/namespace, using a NameSearchContext to make Decls for them.
[in] | context | The NameSearchContext that can construct Decls for this name. |
[in] | module | If non-NULL, the module to query. |
[in] | namespace_decl | If valid and module is non-NULL, the parent namespace. |
Definition at line 1338 of file ClangExpressionDeclMap.cpp.
References AddOneGenericVariable(), AddOneRegister(), AddOneVariable(), lldb_private::ConstString::AsCString(), lldb_private::ValueObjectVariable::Create(), error(), lldb_private::Expressions, FindGlobalVariable(), g_lldb_local_vars_namespace_cstr, lldb_private::GetLog(), lldb_private::CompilerDeclContext::GetName(), lldb_private::ConstString::GetStringRef(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::ClangASTSource::IgnoreName(), LLDB_LOG, LookupFunction(), LookupInModulesDeclVendor(), LookUpLldbClass(), LookUpLldbObjCClass(), LookupLocalVariable(), LookupLocalVarNamespace(), lldb_private::ClangASTSource::m_ast_context, lldb_private::NameSearchContext::m_decl_name, lldb_private::NameSearchContext::m_found_function_with_type_info, lldb_private::NameSearchContext::m_found_variable, m_parser_vars, lldb_private::RegisterInfo::name, SearchPersistenDecls(), and warning().
|
private |
Given a target, find a variable that matches the given name and type.
[in] | target | The target to use as a basis for finding the variable. |
[in] | module | If non-NULL, the module to search. |
[in] | name | The name as a plain C string. |
[in] | namespace_decl | If non-NULL and module is non-NULL, the parent namespace. |
Definition at line 628 of file ClangExpressionDeclMap.cpp.
References lldb_private::ModuleList::FindGlobalVariables(), lldb_private::Target::GetImages(), lldb_private::VariableList::GetSize(), and lldb_private::VariableList::GetVariableAtIndex().
Referenced by FindExternalVisibleDecls().
bool ClangExpressionDeclMap::GetFunctionInfo | ( | const clang::NamedDecl * | decl, |
uint64_t & | ptr | ||
) |
[Used by IRForTarget] Get information about a function given its Decl.
[in] | decl | The parsed Decl for the Function, as generated by ClangASTSource on ClangExpressionDeclMap's behalf. |
[out] | ptr | The absolute address of the function in the target. |
Definition at line 501 of file ClangExpressionDeclMap.cpp.
References lldb_private::ClangExpressionVariable::FindVariableInList(), GetParserID(), lldb_private::ClangExpressionVariable::GetParserVars(), lldb_private::Value::GetScalar(), m_found_entities, lldb_private::ClangExpressionVariable::ParserVars::m_lldb_value, and lldb_private::Scalar::ULongLong().
|
inlineprivate |
Get this parser's ID for use in extracting parser- and JIT-specific data from persistent variables.
Definition at line 388 of file ClangExpressionDeclMap.h.
Referenced by AddExpressionVariable(), AddOneFunction(), AddOneGenericVariable(), AddOneRegister(), AddOneVariable(), AddPersistentVariable(), AddValueToStruct(), DidParse(), GetFunctionInfo(), and GetStructElement().
|
protectedvirtual |
Retrieves the declaration with the given name from the storage of persistent declarations.
Definition at line 735 of file ClangExpressionDeclMap.cpp.
References lldb_private::ScratchTypeSystemClang::GetForTarget(), and m_parser_vars.
Referenced by SearchPersistenDecls().
|
inlineprivate |
Definition at line 381 of file ClangExpressionDeclMap.h.
References lldb_private::ScratchTypeSystemClang::GetForTarget(), and lldb_private::ClangASTSource::m_ast_context.
Referenced by AddOneGenericVariable(), AddPersistentVariable(), and DeportType().
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.
[out] | decl | The 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] | value | The 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] | offset | The 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] | name | The name of the field as used in materialization. |
[in] | index | The index of the field about which information is requested. |
Definition at line 465 of file ClangExpressionDeclMap.cpp.
References GetParserID(), lldb_private::ExpressionVariableList::GetSize(), lldb_private::ExpressionVariableList::GetVariableAtIndex(), lldb_private::ClangExpressionVariable::ParserVars::m_llvm_value, lldb_private::ClangExpressionVariable::ParserVars::m_named_decl, lldb_private::ClangExpressionVariable::JITVars::m_offset, m_struct_members, and m_struct_vars.
Referenced by IRForTarget::ReplaceVariables().
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.
[out] | num_elements | The number of elements in the struct. |
[out] | size | The size of the struct, in bytes. |
[out] | alignment | The alignment of the struct, in bytes. |
Definition at line 451 of file ClangExpressionDeclMap.cpp.
References lldb_private::ExpressionVariableList::GetSize(), m_struct_members, and m_struct_vars.
Referenced by IRForTarget::ReplaceVariables().
addr_t ClangExpressionDeclMap::GetSymbolAddress | ( | ConstString | name, |
lldb::SymbolType | symbol_type | ||
) |
Definition at line 616 of file ClangExpressionDeclMap.cpp.
References GetSymbolAddress(), and m_parser_vars.
addr_t ClangExpressionDeclMap::GetSymbolAddress | ( | Target & | target, |
Process * | process, | ||
ConstString | name, | ||
lldb::SymbolType | symbol_type, | ||
lldb_private::Module * | module = nullptr |
||
) |
[Used by IRForTarget] Get the address of a symbol given nothing but its name.
[in] | target | The target to find the symbol in. If not provided, then the current parsing context's Target. |
[in] | process | The process to use. For Objective-C symbols, the process's Objective-C language runtime may be queried if the process is non-NULL. |
[in] | name | The name of the symbol. |
[in] | module | The module to limit the search to. This can be NULL |
Definition at line 520 of file ClangExpressionDeclMap.cpp.
References lldb_private::FileSpec::ClearDirectory(), 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::ObjCLanguageRuntime::Get(), lldb_private::Address::GetCallableLoadAddress(), lldb_private::Target::GetImages(), lldb_private::Address::GetLoadAddress(), lldb_private::ModuleSpec::GetPlatformFileSpec(), GetSymbolAddress(), lldb_private::Address::IsValid(), LLDB_INVALID_ADDRESS, and lldb_private::LanguageRuntime::LookupRuntimeSymbol().
Referenced by GetSymbolAddress(), IRForTarget::HandleObjCClass(), and IRForTarget::HandleSymbol().
ClangExpressionDeclMap::TargetInfo ClangExpressionDeclMap::GetTargetInfo | ( | ) |
Definition at line 182 of file ClangExpressionDeclMap.cpp.
References lldb_private::ClangExpressionDeclMap::TargetInfo::address_byte_size, lldb_private::ClangExpressionDeclMap::TargetInfo::byte_order, lldb_private::Process::GetAddressByteSize(), lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), lldb_private::Process::GetByteOrder(), lldb_private::ArchSpec::GetByteOrder(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::ExecutionContext::GetTargetPtr(), and m_parser_vars.
Referenced by WillParse().
|
private |
Definition at line 643 of file ClangExpressionDeclMap.cpp.
References lldb_private::SymbolContext::block, lldb_private::Block::GetDeclContext(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::CompilerDeclContext::GetTypeSystem(), and m_parser_vars.
|
private |
Get the value of a variable in a given execution context and return the associated Types if needed.
[in] | var | The variable to evaluate. |
[out] | var_location | The variable location value to fill in |
[out] | found_type | The type of the found value, as it was found in the user process. This is only useful when the variable is being inspected on behalf of the parser, hence the default. |
[out] | parser_type | The type of the found value, as it was copied into the parser's AST context. This is only useful when the variable is being inspected on behalf of the parser, hence the default. |
Definition at line 1468 of file ClangExpressionDeclMap.cpp.
References lldb_private::Status::AsCString(), lldb_private::CompilerType::TypeSystemSPWrapper::dyn_cast_or_null(), lldb_private::Expressions, lldb_private::Value::FileAddress, lldb_private::DataExtractor::GetByteSize(), lldb_private::Value::GetContextType(), lldb_private::DataExtractor::GetDataStart(), lldb_private::DWARFExpressionList::GetExpressionData(), lldb_private::Type::GetForwardCompilerType(), lldb_private::Type::GetFullCompilerType(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLog(), lldb_private::Value::GetScalar(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::Value::GetValueType(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::Value::HostAddress, lldb_private::Value::Invalid, LLDB_INVALID_ADDRESS, LLDB_LOG, lldb_private::Value::LoadAddress, m_parser_vars, lldb_private::SymbolContext::module_sp, lldb_private::Value::SetCompilerType(), lldb_private::Value::SetValueType(), and lldb_private::Scalar::ULongLong().
Referenced by AddOneVariable().
void ClangExpressionDeclMap::InstallCodeGenerator | ( | clang::ASTConsumer * | code_gen | ) |
Definition at line 143 of file ClangExpressionDeclMap.cpp.
References m_parser_vars.
Referenced by lldb_private::ClangExpressionParser::ParseInternal().
void ClangExpressionDeclMap::InstallDiagnosticManager | ( | DiagnosticManager & | diag_manager | ) |
Definition at line 149 of file ClangExpressionDeclMap.cpp.
References m_parser_vars.
Referenced by lldb_private::ClangExpressionParser::ParseInternal().
|
private |
Looks up a function.
[in] | context | The NameSearchContext that can construct Decls for this name. |
[in] | module_sp | If non-NULL, the module to query. |
[in] | name | The name of the function that should be find. |
[in] | namespace_decl | If valid and module is non-NULL, the parent namespace. |
Definition at line 1219 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddNamedDecl(), AddOneFunction(), lldb_private::SymbolContext::block, lldb_private::ClangASTSource::CopyDecl(), lldb::eSymbolTypeReExported, lldb_private::ModuleList::FindFunctions(), lldb_private::ClangASTSource::GetClangModulesDeclVendor(), lldb_private::Block::GetDeclContext(), lldb_private::Target::GetImages(), lldb_private::SymbolContextList::GetSize(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::Symbol::GetType(), lldb_private::ModuleFunctionSearchOptions::include_inlines, lldb_private::ModuleFunctionSearchOptions::include_symbols, lldb_private::CompilerDeclContext::IsClassMethod(), lldb_private::Symbol::IsExternal(), lldb_private::NameSearchContext::m_found_function_with_type_info, m_parser_vars, lldb_private::Symbol::ResolveReExportedSymbol(), SearchFunctionsInSymbolContexts(), and UINT32_MAX.
Referenced by FindExternalVisibleDecls().
|
private |
Lookup entities in the ClangModulesDeclVendor.
[in] | context | The NameSearchContext that can construct Decls for this name. |
[in] | name | The name of the entities that need to be found. |
Definition at line 1011 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::ClangASTSource::CopyDecl(), lldb_private::Expressions, lldb_private::ClangASTSource::GetClangModulesDeclVendor(), lldb_private::GetLog(), LLDB_LOG, lldb_private::NameSearchContext::m_found_function_with_type_info, lldb_private::NameSearchContext::m_found_variable, lldb_private::ClangASTSource::m_target, and MaybeRegisterFunctionBody().
Referenced by FindExternalVisibleDecls().
|
private |
Handles looking up $__lldb_class which requires special treatment.
[in] | context | The NameSearchContext that can construct Decls for this name. |
Definition at line 778 of file ClangExpressionDeclMap.cpp.
References AddContextClassType(), lldb_private::ValueObject::AddressOf(), lldb_private::TypeSystemClang::DeclContextGetAsCXXMethodDecl(), lldb_private::Expressions, lldb_private::Status::Fail(), lldb_private::VariableList::FindVariable(), lldb_private::ValueObject::GetCompilerType(), lldb_private::Block::GetDeclContext(), lldb_private::Type::GetForwardCompilerType(), lldb_private::SymbolContext::GetFunctionBlock(), lldb_private::GetLog(), lldb_private::CompilerType::GetPointeeType(), lldb_private::ClangUtil::GetQualType(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::CompilerDeclContext::GetTypeSystem(), lldb_private::StackFrame::GetVariableList(), LLDB_LOG, m_ctx_obj, and m_parser_vars.
Referenced by FindExternalVisibleDecls().
|
private |
Handles looking up $__lldb_objc_class which requires special treatment.
[in] | context | The NameSearchContext that can construct Decls for this name. |
Definition at line 884 of file ClangExpressionDeclMap.cpp.
References AddOneType(), lldb_private::ValueObject::AddressOf(), lldb_private::TypeSystemClang::DeclContextGetAsObjCMethodDecl(), lldb_private::Expressions, lldb_private::Status::Fail(), lldb_private::VariableList::FindVariable(), lldb_private::ValueObject::GetCompilerType(), lldb_private::Block::GetDeclContext(), lldb_private::Type::GetFullCompilerType(), lldb_private::SymbolContext::GetFunctionBlock(), lldb_private::GetLog(), lldb_private::CompilerType::GetPointeeType(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::CompilerDeclContext::GetTypeSystem(), lldb_private::StackFrame::GetVariableList(), lldb_private::TypeSystemClang::IsObjCClassType(), lldb_private::TypeSystemClang::IsObjCObjectPointerType(), LLDB_LOG, m_ctx_obj, m_parser_vars, and lldb_private::ClangUtil::ToString().
Referenced by FindExternalVisibleDecls().
|
private |
Looks up a local variable.
[in] | context | The NameSearchContext that can construct Decls for this name. |
[in] | name | The name of the entities that need to be found. |
[in] | sym_ctx | The current SymbolContext of this frame. |
[in] | namespace_decl | The parent namespace if there is one. |
Definition at line 1057 of file ClangExpressionDeclMap.cpp.
References AddOneVariable(), lldb_private::SymbolContext::block, lldb_private::ValueObjectVariable::Create(), lldb_private::CompilerDeclContext::FindDeclByName(), lldb_private::Block::GetDeclContext(), lldb_private::StackFrame::GetInScopeVariableList(), lldb_private::ClangExpressionUtil::GetLambdaValueObject(), lldb_private::CompilerDeclContext::IsValid(), lldb_private::NameSearchContext::m_found_variable, and m_parser_vars.
Referenced by FindExternalVisibleDecls().
|
private |
Handles looking up the synthetic namespace that contains our local variables for the current frame.
[in] | sym_ctx | The current SymbolContext of this frame. |
[in] | name_context | The NameSearchContext that can construct Decls for this name. |
Definition at line 985 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::SymbolContext::block, g_lldb_local_vars_namespace_cstr, lldb_private::Block::GetDeclContext(), lldb_private::CompilerDeclContext::GetTypeSystem(), lldb_private::TypeSystemClang::GetUniqueNamespaceDeclaration(), lldb_private::ClangASTSource::m_clang_ast_context, and lldb_private::NameSearchContext::m_found_local_vars_nsp.
Referenced by FindExternalVisibleDecls().
|
private |
Should be called on all copied functions.
Definition at line 727 of file ClangExpressionDeclMap.cpp.
References m_parser_vars.
Referenced by LookupInModulesDeclVendor(), and SearchPersistenDecls().
|
private |
Searches for functions in the given SymbolContextList.
[in] | sc_list | The SymbolContextList to search. |
[in] | frame_decl_context | The current DeclContext of the current frame. |
Definition at line 1136 of file ClangExpressionDeclMap.cpp.
References lldb_private::SymbolContextList::Append(), lldb_private::TypeSystemClang::CountDeclLevels(), lldb_private::Function::GetDeclContext(), lldb_private::Type::GetFullCompilerType(), lldb_private::Function::GetName(), lldb_private::CompilerDeclContext::GetOpaqueDeclContext(), lldb_private::SymbolContextList::GetSize(), lldb_private::Function::GetType(), lldb_private::CompilerDeclContext::GetTypeSystem(), lldb_private::ClangASTSource::GuardedCopyType(), lldb_private::CompilerDeclContext::IsClassMethod(), and LLDB_INVALID_DECL_LEVEL.
Referenced by LookupFunction().
|
private |
Searches the persistent decls of the target for entities with the given name.
[in] | context | The NameSearchContext that can construct Decls for this name. |
[in] | name | The name of the entities that need to be found. |
Definition at line 749 of file ClangExpressionDeclMap.cpp.
References lldb_private::NameSearchContext::AddNamedDecl(), lldb_private::ClangASTSource::CopyDecl(), lldb_private::Expressions, lldb_private::GetLog(), GetPersistentDecl(), LLDB_LOG, and MaybeRegisterFunctionBody().
Referenced by FindExternalVisibleDecls().
bool ClangExpressionDeclMap::WillParse | ( | ExecutionContext & | exe_ctx, |
Materializer * | materializer | ||
) |
Enable the state needed for parsing and IR transformation.
[in] | exe_ctx | The execution context to use when finding types for variables. Also used to find a "scratch" AST context to store result types. |
[in] | materializer | If non-NULL, the materializer to populate with information about the variables to use |
Definition at line 107 of file ClangExpressionDeclMap.cpp.
References lldb::eLanguageTypeC, EnableParserVars(), lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::ExecutionContext::GetFramePtr(), lldb_private::Target::GetPersistentExpressionStateForLanguage(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Thread::GetStackFrameAtIndex(), lldb_private::StackFrame::GetSymbolContext(), GetTargetInfo(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::ExecutionContext::GetTargetSP(), lldb_private::ExecutionContext::GetThreadPtr(), and m_parser_vars.
Referenced by lldb_private::ClangUserExpression::Complete(), and lldb_private::ClangUserExpression::TryParse().
|
private |
If not empty, then expression is evaluated in context of this object.
For details see the comment to UserExpression::Evaluate
.
Definition at line 304 of file ClangExpressionDeclMap.h.
Referenced by LookUpLldbClass(), and LookUpLldbObjCClass().
|
private |
All entities that were looked up for the parser.
Definition at line 295 of file ClangExpressionDeclMap.h.
Referenced by AddExpressionVariable(), AddOneFunction(), AddOneGenericVariable(), AddOneRegister(), AddPersistentVariable(), AddValueToStruct(), DidParse(), and GetFunctionInfo().
|
private |
True if result persistent variables generated by this expression should stay in memory.
Definition at line 298 of file ClangExpressionDeclMap.h.
Referenced by AddPersistentVariable().
|
private |
Definition at line 343 of file ClangExpressionDeclMap.h.
Referenced by AddOneFunction(), AddOneGenericVariable(), AddOneRegister(), AddOneVariable(), AddPersistentVariable(), AddValueToStruct(), DidParse(), DisableParserVars(), DoStructLayout(), EnableParserVars(), FindExternalVisibleDecls(), GetPersistentDecl(), GetSymbolAddress(), GetTargetInfo(), GetTypeSystemClang(), GetVariableValue(), InstallCodeGenerator(), InstallDiagnosticManager(), LookupFunction(), LookUpLldbClass(), LookUpLldbObjCClass(), LookupLocalVariable(), MaybeRegisterFunctionBody(), and WillParse().
|
private |
If non-NULL, used to report expression results to ClangUserExpression.
Definition at line 302 of file ClangExpressionDeclMap.h.
Referenced by AddPersistentVariable().
|
private |
All entities that need to be placed in the struct.
Definition at line 297 of file ClangExpressionDeclMap.h.
Referenced by AddValueToStruct(), GetStructElement(), and GetStructInfo().
|
private |
Definition at line 370 of file ClangExpressionDeclMap.h.
Referenced by AddValueToStruct(), DisableStructVars(), DoStructLayout(), EnableStructVars(), GetStructElement(), and GetStructInfo().