Hi David,
Sorry, I forget to attach the valgrind dump to this. I was not sure if my implementation was ok, so I wanted to ask if I’ve done something wrong first.
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0xB
at 0x54F4516: llvm::object::COFFObjectFile::moveSectionNext(llvm::object::DataRefImpl&) const (COFFObjectFile.cpp:267)
by 0x55A62FB: llvm::object::ObjectFile::isBerkeleyText(llvm::object::DataRefImpl) const (ObjectFile.cpp:80)
by 0x5538CF9: llvm::object::RelocationRef::getType() const (ObjectFile.h:543)
by 0x55AE53E: llvm::object::resolveARM(llvm::object::RelocationRef, unsigned long, unsigned long) (RelocationResolver.cpp:250)
by 0x502802B: llvm::DWARFDataExtractor::getRelocatedValue(unsigned int, unsigned int*, unsigned long*) const (DWARFDataExtractor.cpp:27)
by 0x5071C2F: llvm::DWARFUnitHeader::extract(llvm::DWARFContext&, llvm::DWARFDataExtractor const&, unsigned int*, llvm::DWARFSectionKind, llvm::DWARFUnitIndex const*, llvm::DWARFUnitIndex::Entr y const*) (DWARFUnit.cpp:254)
by 0x5070BAD: llvm::DWARFUnitVector::addUnitsImpl(llvm::DWARFContext&, llvm::DWARFObject const&, llvm::DWARFSection const&, llvm::DWARFDebugAbbrev const*, llvm::DWARFSection const*, llvm::DWARF Section const*, llvm::StringRef, llvm::DWARFSection const&, llvm::DWARFSection const*, llvm::DWARFSection const&, bool, bool, bool, llvm::DWARFSectionKind)::{lambda(unsigned int, llvm::DWARFSectionKind, llvm ::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*)#1}::operator()(unsigned int, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*) const (DWARFUnit.cpp:82)
by 0x50751E1: std::_Function_handler<std::unique_ptr<llvm::DWARFUnit, std::default_deletellvm::DWARFUnit > (unsigned int, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitInd ex::Entry const*), llvm::DWARFUnitVector::addUnitsImpl(llvm::DWARFContext&, llvm::DWARFObject const&, llvm::DWARFSection const&, llvm::DWARFDebugAbbrev const*, llvm::DWARFSection const*, llvm::DWARFSection c onst*, llvm::StringRef, llvm::DWARFSection const&, llvm::DWARFSection const*, llvm::DWARFSection const&, bool, bool, bool, llvm::DWARFSectionKind)::{lambda(unsigned int, llvm::DWARFSectionKind, llvm::DWARFSe ction const*, llvm::DWARFUnitIndex::Entry const*)#1}>::_M_invoke(std::_Any_data const&, unsigned int, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*) (functional:2057)
by 0x507656E: std::function<std::unique_ptr<llvm::DWARFUnit, std::default_deletellvm::DWARFUnit > (unsigned int, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*)>::operator()(unsigned int, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*) const (functional:2471)
by 0x5070FE6: llvm::DWARFUnitVector::addUnitsImpl(llvm::DWARFContext&, llvm::DWARFObject const&, llvm::DWARFSection const&, llvm::DWARFDebugAbbrev const*, llvm::DWARFSection const*, llvm::DWARF Section const*, llvm::StringRef, llvm::DWARFSection const&, llvm::DWARFSection const*, llvm::DWARFSection const&, bool, bool, bool, llvm::DWARFSectionKind) (DWARFUnit.cpp:111)
by 0x50708CF: llvm::DWARFUnitVector::addUnitsForSection(llvm::DWARFContext&, llvm::DWARFSection const&, llvm::DWARFSectionKind) (DWARFUnit.cpp:44)
by 0x5000AAE: llvm::DWARFContext::parseNormalUnits()::{lambda(llvm::DWARFSection const&)#1}::operator()(llvm::DWARFSection const&) const (DWARFContext.cpp:881)
However, I can’t see how this error can relate to the wrapping/unwrapping macros generating C structure?
Thanks a lot for your time