From 649b8e0c45854f4c7938284b337c17ca968cafa9 Mon Sep 17 00:00:00 2001 From: Adrian McCarthy Date: Fri, 24 Feb 2017 00:10:47 +0000 Subject: Implement some methods for NativeRawSymbol This allows the ability to call IPDBSession::getGlobalScope with a NativeSession and to then query it for some basic fields from the PDB's InfoStream. Note that the symbols now have non-const references back to the Session so that NativeRawSymbol can access the PDBFile through the Session. Differential Revision: https://reviews.llvm.org/D30314 llvm-svn: 296049 --- llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp index cafaa9bffa3..6827fbf4fb4 100644 --- a/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp @@ -14,6 +14,7 @@ #include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/IPDBSourceFile.h" +#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h" #include "llvm/DebugInfo/PDB/Native/PDBFile.h" #include "llvm/DebugInfo/PDB/Native/RawError.h" #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h" @@ -68,8 +69,12 @@ uint64_t NativeSession::getLoadAddress() const { return 0; } void NativeSession::setLoadAddress(uint64_t Address) {} -std::unique_ptr NativeSession::getGlobalScope() const { - return nullptr; +std::unique_ptr NativeSession::getGlobalScope() { + auto RawSymbol = llvm::make_unique(*this); + auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol))); + std::unique_ptr ExeSymbol( + static_cast(PdbSymbol.release())); + return ExeSymbol; } std::unique_ptr -- cgit v1.2.3