9#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONDECLMAP_H
10#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONDECLMAP_H
27#include "clang/AST/Decl.h"
28#include "llvm/ADT/DenseMap.h"
32class ClangPersistentVariables;
82 bool keep_result_in_memory,
85 const std::shared_ptr<ClangASTImporter> &importer,
ValueObject *ctx_obj);
128 bool is_result,
bool is_lvalue);
151 llvm::Value *value,
size_t size,
246 Module *module =
nullptr);
Provider for named objects defined in the debug info for Clang.
clang::ASTContext * m_ast_context
The AST context requests are coming in for.
The following values should not live beyond parsing.
ClangPersistentVariables * m_persistent_vars
The persistent variables for the process.
bool m_enable_lookups
Set to true during parsing if we have found the first "$__lldb" name.
ParserVars(const ParserVars &)=delete
clang::ASTConsumer * m_code_gen
If non-NULL, a code generator that receives new top-level functions.
const ParserVars & operator=(const ParserVars &)=delete
TargetInfo m_target_info
Basic information about the target.
ExecutionContext m_exe_ctx
The execution context to use when parsing.
Materializer * m_materializer
If non-NULL, the materializer to use when reporting used variables.
DiagnosticManager * m_diagnostics
SymbolContext m_sym_ctx
The symbol context to use in finding variables and types.
"lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are defined in LLDB's debug in...
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 o...
std::unique_ptr< StructVars > m_struct_vars
void EnableParserVars()
Activate parser-specific variables.
uint64_t GetParserID()
Get this parser's ID for use in extracting parser- and JIT-specific data from persistent variables.
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.
TargetInfo GetTargetInfo()
bool LookupLocalVariable(NameSearchContext &context, ConstString name, SymbolContext &sym_ctx, const CompilerDeclContext &namespace_decl)
Looks up a local variable.
void DisableStructVars()
Deallocate struct variables.
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 lis...
void FindExternalVisibleDecls(NameSearchContext &context) override
[Used by ClangASTSource] Find all entities matching a given name, using a NameSearchContext to make D...
void AddOneFunction(NameSearchContext &context, Function *fun, Symbol *sym)
Use the NameSearchContext to generate a Decl for the given function.
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 DoStructL...
bool DoStructLayout()
[Used by IRForTarget] Finalize the struct, laying out the position of each object in it.
void MaybeRegisterFunctionBody(clang::FunctionDecl *copied_function_decl)
Should be called on all copied functions.
void EnableStructVars()
Activate struct variables.
void AddOneGenericVariable(NameSearchContext &context, const Symbol &symbol)
Use the NameSearchContext to generate a Decl for the given LLDB symbol (treated as a variable),...
void DidParse()
Disable the state needed for parsing and IR transformation.
void AddOneRegister(NameSearchContext &context, const RegisterInfo *reg_info)
Use the NameSearchContext to generate a Decl for the given register.
bool WillParse(ExecutionContext &exe_ctx, Materializer *materializer)
Enable the state needed for parsing and IR transformation.
void LookUpLldbObjCClass(NameSearchContext &context)
Handles looking up $__lldb_objc_class which requires special treatment.
void DisableParserVars()
Deallocate parser-specific variables.
void LookupLocalVarNamespace(SymbolContext &sym_ctx, NameSearchContext &name_context)
Handles looking up the synthetic namespace that contains our local variables for the current frame.
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 expres...
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.
void InstallDiagnosticManager(DiagnosticManager &diag_manager)
void LookUpLldbClass(NameSearchContext &context)
Handles looking up $__lldb_class which requires special treatment.
bool m_keep_result_in_memory
True if result persistent variables generated by this expression should stay in memory.
bool GetFunctionInfo(const clang::NamedDecl *decl, uint64_t &ptr)
[Used by IRForTarget] Get information about a function given its Decl.
lldb::TypeSystemClangSP GetScratchContext(Target &target)
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 a...
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 be...
SymbolContextList SearchFunctionsInSymbolContexts(const SymbolContextList &sc_list, const CompilerDeclContext &frame_decl_context)
Searches for functions in the given SymbolContextList.
ExpressionVariableList m_struct_members
All entities that need to be placed in the struct.
ExpressionVariableList m_found_entities
All entities that were looked up for the parser.
~ClangExpressionDeclMap() override
Destructor.
void SearchPersistenDecls(NameSearchContext &context, const ConstString name)
Searches the persistent decls of the target for entities with the given name.
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...
Materializer::PersistentVariableDelegate * m_result_delegate
If non-NULL, used to report expression results to ClangUserExpression.
void LookupFunction(NameSearchContext &context, lldb::ModuleSP module_sp, ConstString name, const CompilerDeclContext &namespace_decl)
Looks up a function.
void LookupInModulesDeclVendor(NameSearchContext &context, ConstString name)
Lookup entities in the ClangModulesDeclVendor.
void AddOneType(NameSearchContext &context, const TypeFromUser &type)
Use the NameSearchContext to generate a Decl for the given type.
TypeSystemClang * GetTypeSystemClang()
ValueObject * m_ctx_obj
If not empty, then expression is evaluated in context of this object.
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.
std::unique_ptr< ParserVars > m_parser_vars
void InstallCodeGenerator(clang::ASTConsumer *code_gen)
virtual clang::NamedDecl * GetPersistentDecl(ConstString name)
Retrieves the declaration with the given name from the storage of persistent declarations.
The following values should not live beyond parsing.
"lldb/Expression/ClangPersistentVariables.h" Manages persistent values that need to be preserved betw...
Represents a generic declaration context in a program.
A uniqued constant string class.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Target * GetTargetPtr() const
Returns a pointer to the target object.
"lldb/Expression/ExpressionVariable.h" A list of variable references.
A class that describes a function.
A class that describes an executable image and its associated object and symbol files.
A plug-in interface definition class for debugging a process.
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
lldb::TargetSP target_sp
The Target for a given query.
A TypeSystem implementation based on Clang.
A class that represents a running process on the host machine.
TaggedASTType< 0 > TypeFromParser
std::function< lldb::ValueObjectSP(ConstString, StackFrame *)> ValueObjectProviderTy
Functor that returns a ValueObjectSP for a variable given its name and the StackFrame of interest.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ExpressionVariable > ExpressionVariableSP
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::Variable > VariableSP
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP
The following values contain layout information for the materialized struct, but are not specific to ...
lldb::offset_t m_struct_alignment
The alignment of the struct in bytes.
ConstString m_result_name
The name of the result variable ($1, for example)
bool m_struct_laid_out
True if the struct has been laid out and the layout is valid (that is, no new fields have been added ...
size_t m_struct_size
The size of the struct in bytes.
lldb::ByteOrder byte_order
"lldb/Expression/ClangASTSource.h" Container for all objects relevant to a single name lookup
Every register is described in detail including its name, alternate name (optional),...