Skip to content

Commit

Permalink
Merge pull request #43 from igvk/SectionScope
Browse files Browse the repository at this point in the history
Scope of sections shouldn't be limited to processSections
  • Loading branch information
Mixaill authored Sep 21, 2024
2 parents a105a8d + 4fe04c3 commit 40531aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src_cpp/src_pdb/pdb/pdb_creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ namespace FakePDB::PDB {

bool PdbCreator::processSections(Data::DB& ida_db) {
auto &DbiBuilder = _pdbBuilder.getDbiBuilder();
_sections.clear();

// Add Section Map stream.
std::vector<llvm::object::coff_section> sections;
for (const auto& segment : ida_db.Segments()) {
sections.push_back(segment.toLLVM());
_sections.push_back(segment.toLLVM());
}

DbiBuilder.createSectionMap(sections);
DbiBuilder.createSectionMap(_sections);

// Add COFF section header stream.
auto sectionsTable = llvm::ArrayRef<uint8_t>(
reinterpret_cast<const uint8_t*>(sections.data()),
sections.size()*sizeof(llvm::object::coff_section));
reinterpret_cast<const uint8_t*>(_sections.data()),
_sections.size()*sizeof(llvm::object::coff_section));

if (DbiBuilder.addDbgStream(llvm::pdb::DbgHeaderType::SectionHdr, sectionsTable)) {
return false;
Expand Down
1 change: 1 addition & 0 deletions src_cpp/src_pdb/pdb/pdb_creator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ namespace FakePDB::PDB {

llvm::BumpPtrAllocator _allocator;
llvm::pdb::PDBFileBuilder _pdbBuilder;
std::vector<llvm::object::coff_section> _sections;
};
}

0 comments on commit 40531aa

Please sign in to comment.