summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-10-26 09:06:38 +0000
committerZachary Turner <zturner@google.com>2018-10-26 09:06:38 +0000
commit9f727950a534d288e223fc82cb5fa73a30486ab1 (patch)
tree2470acc8386b4d07f87794a7f16abb9191f31f7a /lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
parentb547ef2a29686b50707633c6525f2448b6ab6e48 (diff)
downloadbcm5719-llvm-9f727950a534d288e223fc82cb5fa73a30486ab1.tar.gz
bcm5719-llvm-9f727950a534d288e223fc82cb5fa73a30486ab1.zip
[NativePDB] Add the ability to dump dump global variables.
LLDB has the ability to display global variables, even without a running process, via the target variable command. This is because global variables are linker initialized, so their values are embedded directly into the executables. This gives us great power for testing native PDB functionality in a cross-platform manner, because we don't actually need a running process. We can just create a target using an EXE file, and display global variables. And global variables can have arbitrarily complex types, so in theory we can fully exercise the type system, record layout, and data formatters for native PDB files and PE/COFF executables on any host platform, as long as our type does not require a dynamic initializer. This patch adds basic support for finding variables by name, and adds an exhaustive test for fundamental data types and pointers / references to fundamental data types. Subsequent patches will extend this to typedefs, classes, pointers to functions, and other cases. Differential Revision: https://reviews.llvm.org/D53731 llvm-svn: 345373
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
index 9a67740c6cf..67006b29c2e 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
@@ -103,6 +103,11 @@ public:
size_t ParseFunctionBlocks(const SymbolContext &sc) override;
+ uint32_t FindGlobalVariables(const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ uint32_t max_matches,
+ VariableList &variables) override;
+
size_t ParseTypes(const SymbolContext &sc) override;
size_t ParseVariablesForContext(const SymbolContext &sc) override {
return 0;
@@ -175,11 +180,13 @@ private:
lldb::CompUnitSP GetOrCreateCompileUnit(const CompilandIndexItem &cci);
lldb::TypeSP GetOrCreateType(PdbSymUid type_uid);
lldb::TypeSP GetOrCreateType(llvm::codeview::TypeIndex ti);
+ lldb::VariableSP GetOrCreateGlobalVariable(PdbSymUid var_uid);
lldb::FunctionSP CreateFunction(PdbSymUid func_uid, const SymbolContext &sc);
lldb::CompUnitSP CreateCompileUnit(const CompilandIndexItem &cci);
lldb::TypeSP CreateType(PdbSymUid type_uid);
lldb::TypeSP CreateAndCacheType(PdbSymUid type_uid);
+ lldb::VariableSP CreateGlobalVariable(PdbSymUid var_uid);
llvm::BumpPtrAllocator m_allocator;
@@ -193,6 +200,7 @@ private:
llvm::DenseMap<lldb::user_id_t, clang::TagDecl *> m_uid_to_decl;
+ llvm::DenseMap<lldb::user_id_t, lldb::VariableSP> m_global_vars;
llvm::DenseMap<lldb::user_id_t, lldb::FunctionSP> m_functions;
llvm::DenseMap<lldb::user_id_t, lldb::CompUnitSP> m_compilands;
llvm::DenseMap<lldb::user_id_t, lldb::TypeSP> m_types;
OpenPOWER on IntegriCloud