summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/DIA
diff options
context:
space:
mode:
authorAaron Smith <aaron.smith@microsoft.com>2018-03-26 22:10:02 +0000
committerAaron Smith <aaron.smith@microsoft.com>2018-03-26 22:10:02 +0000
commit53708a5e9e60bfc5e7dc9c1135262d50f39454b4 (patch)
tree4f757af584ecb579a3616f887273bf3de40b7a42 /llvm/lib/DebugInfo/PDB/DIA
parent44357eef97a47072c90f2930a12059aefa09a0e8 (diff)
downloadbcm5719-llvm-53708a5e9e60bfc5e7dc9c1135262d50f39454b4.tar.gz
bcm5719-llvm-53708a5e9e60bfc5e7dc9c1135262d50f39454b4.zip
[DebugInfoPDB] Add DIA implementation of addressForVA and addressForRVA
These are used in finding line numbers for PDBSymbolData llvm-svn: 328585
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/DIA')
-rw-r--r--llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
index a75ee0ef512..16d28b6a434 100644
--- a/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
+++ b/llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
@@ -166,6 +166,28 @@ std::unique_ptr<PDBSymbolExe> DIASession::getGlobalScope() {
return ExeSymbol;
}
+bool DIASession::addressForVA(uint64_t VA, uint32_t &Section,
+ uint32_t &Offset) const {
+ DWORD ArgSection, ArgOffset = 0;
+ if (S_OK == Session->addressForVA(VA, &ArgSection, &ArgOffset)) {
+ Section = static_cast<uint32_t>(ArgSection);
+ Offset = static_cast<uint32_t>(ArgOffset);
+ return true;
+ }
+ return false;
+}
+
+bool DIASession::addressForRVA(uint32_t RVA, uint32_t &Section,
+ uint32_t &Offset) const {
+ DWORD ArgSection, ArgOffset = 0;
+ if (S_OK == Session->addressForRVA(RVA, &ArgSection, &ArgOffset)) {
+ Section = static_cast<uint32_t>(ArgSection);
+ Offset = static_cast<uint32_t>(ArgOffset);
+ return true;
+ }
+ return false;
+}
+
std::unique_ptr<PDBSymbol> DIASession::getSymbolById(uint32_t SymbolId) const {
CComPtr<IDiaSymbol> LocatedSymbol;
if (S_OK != Session->symbolById(SymbolId, &LocatedSymbol))
OpenPOWER on IntegriCloud