[llvm] r328586 - [DebugInfoPDB] Add DIA implementation of findLineNumbersByRVA
Aaron Smith via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 26 15:13:22 PDT 2018
Author: asmith
Date: Mon Mar 26 15:13:22 2018
New Revision: 328586
URL: http://llvm.org/viewvc/llvm-project?rev=328586&view=rev
Log:
[DebugInfoPDB] Add DIA implementation of findLineNumbersByRVA
This method is used to find line numbers for PDBSymbolData
that have an invalid virtual address.
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h
llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h
llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h
llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp
llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp
llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h?rev=328586&r1=328585&r2=328586&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/DIA/DIASession.h Mon Mar 26 15:13:22 2018
@@ -48,6 +48,8 @@ public:
std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override;
std::unique_ptr<IPDBEnumLineNumbers>
+ findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override;
+ std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset,
uint32_t Length) const override;
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h?rev=328586&r1=328585&r2=328586&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/IPDBSession.h Mon Mar 26 15:13:22 2018
@@ -51,6 +51,8 @@ public:
virtual std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersByAddress(uint64_t Address, uint32_t Length) const = 0;
virtual std::unique_ptr<IPDBEnumLineNumbers>
+ findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const = 0;
+ virtual std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset,
uint32_t Length) const = 0;
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h?rev=328586&r1=328585&r2=328586&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/NativeSession.h Mon Mar 26 15:13:22 2018
@@ -67,6 +67,8 @@ public:
std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override;
std::unique_ptr<IPDBEnumLineNumbers>
+ findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override;
+ std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset,
uint32_t Length) const override;
Modified: llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp?rev=328586&r1=328585&r2=328586&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/DIA/DIASession.cpp Mon Mar 26 15:13:22 2018
@@ -245,6 +245,15 @@ DIASession::findLineNumbersByAddress(uin
}
std::unique_ptr<IPDBEnumLineNumbers>
+DIASession::findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const {
+ CComPtr<IDiaEnumLineNumbers> LineNumbers;
+ if (S_OK != Session->findLinesByRVA(RVA, Length, &LineNumbers))
+ return nullptr;
+
+ return llvm::make_unique<DIAEnumLineNumbers>(LineNumbers);
+}
+
+std::unique_ptr<IPDBEnumLineNumbers>
DIASession::findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset,
uint32_t Length) const {
CComPtr<IDiaEnumLineNumbers> LineNumbers;
Modified: llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp?rev=328586&r1=328585&r2=328586&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/NativeSession.cpp Mon Mar 26 15:13:22 2018
@@ -213,6 +213,11 @@ NativeSession::findLineNumbersByAddress(
}
std::unique_ptr<IPDBEnumLineNumbers>
+NativeSession::findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const {
+ return nullptr;
+}
+
+std::unique_ptr<IPDBEnumLineNumbers>
NativeSession::findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset,
uint32_t Length) const {
return nullptr;
Modified: llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp?rev=328586&r1=328585&r2=328586&view=diff
==============================================================================
--- llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp (original)
+++ llvm/trunk/unittests/DebugInfo/PDB/PDBApiTest.cpp Mon Mar 26 15:13:22 2018
@@ -97,6 +97,10 @@ class MockSession : public IPDBSession {
return nullptr;
}
std::unique_ptr<IPDBEnumLineNumbers>
+ findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override {
+ return nullptr;
+ }
+ std::unique_ptr<IPDBEnumLineNumbers>
findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset,
uint32_t Length) const override {
return nullptr;
More information about the llvm-commits
mailing list