summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-10-23 16:37:53 +0000
committerZachary Turner <zturner@google.com>2018-10-23 16:37:53 +0000
commit2f7efbc9ce62d84a215529133f1c384c25a7858e (patch)
tree01cb027df97241b1fb6c35164787ee6a40818a16 /lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
parent2fed6ac186b505a68a30e9e3851b942e74687d6e (diff)
downloadbcm5719-llvm-2f7efbc9ce62d84a215529133f1c384c25a7858e.tar.gz
bcm5719-llvm-2f7efbc9ce62d84a215529133f1c384c25a7858e.zip
[NativePDB] Add basic support for tag types to the native pdb plugin.
This adds support to LLDB for named types (class, struct, union, and enum). This is true cross platform support, and hits the PDB file directly without a dependency on Windows. Tests are added which compile a program with certain interesting types and then use load the target in LLDB and use "type lookup -- <TypeName>" to dump the layout of the type in LLDB without a running process. Currently only fields are parsed -- we do not parse methods. Also we don't deal with bitfields or virtual bases correctly. Those will make good followups. Differential Revision: https://reviews.llvm.org/D53511 llvm-svn: 345047
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
index c9bd9a48568..cda9508c07a 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
@@ -17,6 +17,7 @@
#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
#include "llvm/DebugInfo/PDB/Native/PublicsStream.h"
#include "llvm/DebugInfo/PDB/Native/SymbolStream.h"
+#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
#include "llvm/Object/COFF.h"
#include "llvm/Support/Error.h"
@@ -51,6 +52,8 @@ PdbIndex::create(std::unique_ptr<llvm::pdb::PDBFile> file) {
ASSIGN_PTR_OR_RETURN(result->m_globals, file->getPDBGlobalsStream());
ASSIGN_PTR_OR_RETURN(result->m_symrecords, file->getPDBSymbolStream());
+ result->m_tpi->buildHashMap();
+
result->m_file = std::move(file);
return std::move(result);
@@ -101,6 +104,9 @@ void PdbIndex::ParseSectionContribs() {
: m_ctx(ctx), m_imap(imap) {}
void visit(const SectionContrib &C) override {
+ if (C.Size == 0)
+ return;
+
uint64_t va = m_ctx.MakeVirtualAddress(C.ISect, C.Off);
uint64_t end = va + C.Size;
// IntervalMap's start and end represent a closed range, not a half-open
OpenPOWER on IntegriCloud