summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
index 4841ded7410..3974ddc08a4 100644
--- a/llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
@@ -11,7 +11,11 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
+#include "llvm/DebugInfo/PDB/Native/InfoStream.h"
+#include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"
#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
+#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
#include "llvm/DebugInfo/PDB/PDBExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/raw_ostream.h"
@@ -26,6 +30,21 @@ void NativeRawSymbol::dump(raw_ostream &OS, int Indent) const {}
std::unique_ptr<IPDBEnumSymbols>
NativeRawSymbol::findChildren(PDB_SymType Type) const {
+ switch (Type) {
+ case PDB_SymType::Compiland: {
+ auto &File = Session.getPDBFile();
+ auto Dbi = File.getPDBDbiStream();
+ if (Dbi) {
+ const auto Modules = Dbi->modules();
+ return std::unique_ptr<IPDBEnumSymbols>(
+ new NativeEnumModules(Session, Modules));
+ }
+ consumeError(Dbi.takeError());
+ break;
+ }
+ default:
+ break;
+ }
return nullptr;
}
@@ -63,6 +82,11 @@ uint32_t NativeRawSymbol::getAddressSection() const {
}
uint32_t NativeRawSymbol::getAge() const {
+ auto &File = Session.getPDBFile();
+ auto IS = File.getPDBInfoStream();
+ if (IS)
+ return IS->getAge();
+ consumeError(IS.takeError());
return 0;
}
@@ -248,7 +272,9 @@ uint32_t NativeRawSymbol::getSubTypeId() const {
return 0;
}
-std::string NativeRawSymbol::getSymbolsFileName() const { return ""; }
+std::string NativeRawSymbol::getSymbolsFileName() const {
+ return Session.getPDBFile().getFilePath();
+}
uint32_t NativeRawSymbol::getSymIndexId() const {
return 0;
@@ -327,6 +353,11 @@ PDB_SymType NativeRawSymbol::getSymTag() const {
}
PDB_UniqueId NativeRawSymbol::getGuid() const {
+ auto &File = Session.getPDBFile();
+ auto IS = File.getPDBInfoStream();
+ if (IS)
+ return IS->getGuid();
+ consumeError(IS.takeError());
return PDB_UniqueId{{0}};
}
OpenPOWER on IntegriCloud