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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309987
91177308-0d34-0410-b5e6-
96231b3b80d8
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>
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.