[llvm] r309987 - [PDB] Fix section contributions
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 3 14:15:09 PDT 2017
Author: rnk
Date: Thu Aug 3 14:15:09 2017
New Revision: 309987
URL: http://llvm.org/viewvc/llvm-project?rev=309987&view=rev
Log:
[PDB] Fix section contributions
Summary:
PDB section contributions are supposed to use output section indices and
offsets, not input section indices and offsets.
This allows the debugger to look up the index of the module that it
should look up in the modules stream for symbol information. With this
change, windbg can now find line tables, but it still cannot print local
variables.
Fixes PR34048
Reviewers: zturner
Subscribers: hiraditya, ruiu, llvm-commits
Differential Revision: https://reviews.llvm.org/D36285
Modified:
llvm/trunk/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
llvm/trunk/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h?rev=309987&r1=309986&r2=309987&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h Thu Aug 3 14:15:09 2017
@@ -72,8 +72,9 @@ public:
Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef MsfBuffer);
- void addSectionContrib(DbiModuleDescriptorBuilder *ModuleDbi,
- const llvm::object::coff_section *SecHdr);
+ void addSectionContrib(const SectionContrib &SC) {
+ SectionContribs.emplace_back(SC);
+ }
// A helper function to create a Section Map from a COFF section header.
static std::vector<SecMapEntry>
Modified: llvm/trunk/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp?rev=309987&r1=309986&r2=309987&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp Thu Aug 3 14:15:09 2017
@@ -311,19 +311,6 @@ static uint16_t toSecMapFlags(uint32_t F
return Ret;
}
-void DbiStreamBuilder::addSectionContrib(DbiModuleDescriptorBuilder *ModuleDbi,
- const object::coff_section *SecHdr) {
- SectionContrib SC;
- memset(&SC, 0, sizeof(SC));
- SC.ISect = (uint16_t)~0U; // This represents nil.
- SC.Off = SecHdr->PointerToRawData;
- SC.Size = SecHdr->SizeOfRawData;
- SC.Characteristics = SecHdr->Characteristics;
- // Use the module index in the module dbi stream or nil (-1).
- SC.Imod = ModuleDbi ? ModuleDbi->getModuleIndex() : (uint16_t)~0U;
- SectionContribs.emplace_back(SC);
-}
-
// A utility function to create a Section Map for a given list of COFF sections.
//
// A Section Map seem to be a copy of a COFF section list in other format.
More information about the llvm-commits
mailing list