#include "ClangExpressionDeclMap.h"
#include "ClangASTSource.h"
#include "ClangExpressionUtil.h"
#include "ClangExpressionVariable.h"
#include "ClangModulesDeclVendor.h"
#include "ClangPersistentVariables.h"
#include "ClangUtil.h"
#include "NameSearchContext.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Expression/DiagnosticManager.h"
#include "lldb/Expression/Materializer.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/CompilerDecl.h"
#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/Type.h"
#include "lldb/Symbol/TypeList.h"
#include "lldb/Symbol/Variable.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-private-types.h"
#include "lldb/lldb-private.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTImporter.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h"
#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
usingnamespacelldb;
usingnamespacelldb_private;
usingnamespaceclang;
static const char *g_lldb_local_vars_namespace_cstr = …;
namespace {
lldb::ValueObjectSP GetCapturedThisValueObject(StackFrame *frame) { … }
}
ClangExpressionDeclMap::ClangExpressionDeclMap(
bool keep_result_in_memory,
Materializer::PersistentVariableDelegate *result_delegate,
const lldb::TargetSP &target,
const std::shared_ptr<ClangASTImporter> &importer, ValueObject *ctx_obj)
: … { … }
ClangExpressionDeclMap::~ClangExpressionDeclMap() { … }
bool ClangExpressionDeclMap::WillParse(ExecutionContext &exe_ctx,
Materializer *materializer) { … }
void ClangExpressionDeclMap::InstallCodeGenerator(
clang::ASTConsumer *code_gen) { … }
void ClangExpressionDeclMap::InstallDiagnosticManager(
DiagnosticManager &diag_manager) { … }
void ClangExpressionDeclMap::DidParse() { … }
ClangExpressionDeclMap::TargetInfo ClangExpressionDeclMap::GetTargetInfo() { … }
TypeFromUser ClangExpressionDeclMap::DeportType(TypeSystemClang &target,
TypeSystemClang &source,
TypeFromParser parser_type) { … }
bool ClangExpressionDeclMap::AddPersistentVariable(const NamedDecl *decl,
ConstString name,
TypeFromParser parser_type,
bool is_result,
bool is_lvalue) { … }
bool ClangExpressionDeclMap::AddValueToStruct(const NamedDecl *decl,
ConstString name,
llvm::Value *value, size_t size,
lldb::offset_t alignment) { … }
bool ClangExpressionDeclMap::DoStructLayout() { … }
bool ClangExpressionDeclMap::GetStructInfo(uint32_t &num_elements, size_t &size,
lldb::offset_t &alignment) { … }
bool ClangExpressionDeclMap::GetStructElement(const NamedDecl *&decl,
llvm::Value *&value,
lldb::offset_t &offset,
ConstString &name,
uint32_t index) { … }
bool ClangExpressionDeclMap::GetFunctionInfo(const NamedDecl *decl,
uint64_t &ptr) { … }
addr_t ClangExpressionDeclMap::GetSymbolAddress(Target &target,
Process *process,
ConstString name,
lldb::SymbolType symbol_type,
lldb_private::Module *module) { … }
addr_t ClangExpressionDeclMap::GetSymbolAddress(ConstString name,
lldb::SymbolType symbol_type) { … }
lldb::VariableSP ClangExpressionDeclMap::FindGlobalVariable(
Target &target, ModuleSP &module, ConstString name,
const CompilerDeclContext &namespace_decl) { … }
TypeSystemClang *ClangExpressionDeclMap::GetTypeSystemClang() { … }
void ClangExpressionDeclMap::FindExternalVisibleDecls(
NameSearchContext &context) { … }
void ClangExpressionDeclMap::MaybeRegisterFunctionBody(
FunctionDecl *copied_function_decl) { … }
clang::NamedDecl *ClangExpressionDeclMap::GetPersistentDecl(ConstString name) { … }
void ClangExpressionDeclMap::SearchPersistenDecls(NameSearchContext &context,
const ConstString name) { … }
void ClangExpressionDeclMap::LookUpLldbClass(NameSearchContext &context) { … }
void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) { … }
void ClangExpressionDeclMap::LookupLocalVarNamespace(
SymbolContext &sym_ctx, NameSearchContext &name_context) { … }
void ClangExpressionDeclMap::LookupInModulesDeclVendor(
NameSearchContext &context, ConstString name) { … }
bool ClangExpressionDeclMap::LookupLocalVariable(
NameSearchContext &context, ConstString name, SymbolContext &sym_ctx,
const CompilerDeclContext &namespace_decl) { … }
namespace {
struct FuncDeclInfo { … };
}
SymbolContextList ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(
const SymbolContextList &sc_list,
const CompilerDeclContext &frame_decl_context) { … }
void ClangExpressionDeclMap::LookupFunction(
NameSearchContext &context, lldb::ModuleSP module_sp, ConstString name,
const CompilerDeclContext &namespace_decl) { … }
void ClangExpressionDeclMap::FindExternalVisibleDecls(
NameSearchContext &context, lldb::ModuleSP module_sp,
const CompilerDeclContext &namespace_decl) { … }
bool ClangExpressionDeclMap::GetVariableValue(VariableSP &var,
lldb_private::Value &var_location,
TypeFromUser *user_type,
TypeFromParser *parser_type) { … }
ClangExpressionVariable::ParserVars *
ClangExpressionDeclMap::AddExpressionVariable(NameSearchContext &context,
TypeFromParser const &pt,
ValueObjectSP valobj) { … }
void ClangExpressionDeclMap::AddOneVariable(
NameSearchContext &context, ValueObjectSP valobj,
ValueObjectProviderTy valobj_provider) { … }
void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
VariableSP var,
ValueObjectSP valobj) { … }
void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
ExpressionVariableSP &pvar_sp) { … }
void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context,
const Symbol &symbol) { … }
void ClangExpressionDeclMap::AddOneRegister(NameSearchContext &context,
const RegisterInfo *reg_info) { … }
void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
Function *function,
Symbol *symbol) { … }
void ClangExpressionDeclMap::AddContextClassType(NameSearchContext &context,
const TypeFromUser &ut) { … }
void ClangExpressionDeclMap::AddOneType(NameSearchContext &context,
const TypeFromUser &ut) { … }