mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Revert "[llvm][dwwarf] Change CU/TU index to 64-bit"
This reverts commit 5ebd28f3e5.
This commit is contained in:
@@ -1187,8 +1187,8 @@ void DebugAbbrevWriter::addUnitAbbreviations(DWARFUnit &Unit) {
|
||||
|
||||
const DWARFUnitIndex::Entry::SectionContribution *DWOContrubution =
|
||||
DWOEntry->getContribution(DWARFSectionKind::DW_SECT_ABBREV);
|
||||
AbbrevContents = AbbrevSectionContents.substr(
|
||||
DWOContrubution->getOffset(), DWOContrubution->getLength());
|
||||
AbbrevContents = AbbrevSectionContents.substr(DWOContrubution->Offset,
|
||||
DWOContrubution->Length);
|
||||
} else if (!Unit.isDWOUnit()) {
|
||||
const uint64_t StartOffset = Unit.getAbbreviationsOffset();
|
||||
|
||||
|
||||
@@ -1209,11 +1209,11 @@ updateDebugData(DWARFContext &DWCtx, std::string &Storage,
|
||||
const DWARFUnitIndex::Entry::SectionContribution;
|
||||
auto getSliceData = [&](const DWARFUnitIndex::Entry *DWOEntry,
|
||||
StringRef OutData, DWARFSectionKind Sec,
|
||||
uint64_t &DWPOffset) -> StringRef {
|
||||
uint32_t &DWPOffset) -> StringRef {
|
||||
if (DWOEntry) {
|
||||
DWOSectionContribution *DWOContrubution = DWOEntry->getContribution(Sec);
|
||||
DWPOffset = DWOContrubution->getOffset();
|
||||
OutData = OutData.substr(DWPOffset, DWOContrubution->getLength());
|
||||
DWPOffset = DWOContrubution->Offset;
|
||||
OutData = OutData.substr(DWPOffset, DWOContrubution->Length);
|
||||
}
|
||||
return OutData;
|
||||
};
|
||||
@@ -1224,7 +1224,7 @@ updateDebugData(DWARFContext &DWCtx, std::string &Storage,
|
||||
|
||||
Streamer.switchSection(SectionIter->second.first);
|
||||
StringRef OutData = SectionContents;
|
||||
uint64_t DWPOffset = 0;
|
||||
uint32_t DWPOffset = 0;
|
||||
|
||||
switch (SectionIter->second.second) {
|
||||
default: {
|
||||
@@ -1307,15 +1307,14 @@ static std::string extractDWOTUFromDWP(
|
||||
// Sorting so it's easy to compare output.
|
||||
// They should be sharing the same Abbrev.
|
||||
llvm::sort(TUContributions, [](const TUEntry &V1, const TUEntry &V2) -> bool {
|
||||
return V1.second->getOffset() < V2.second->getOffset();
|
||||
return V1.second->Offset < V2.second->Offset;
|
||||
});
|
||||
|
||||
for (auto &PairEntry : TUContributions) {
|
||||
const DWARFUnitIndex::Entry::SectionContribution *C = PairEntry.second;
|
||||
const uint64_t TUSignature = PairEntry.first;
|
||||
DWOTUSection.append(
|
||||
Contents.slice(C->getOffset(), C->getOffset() + C->getLength()).str());
|
||||
TUContributionsToCU.push_back({TUSignature, C->getLength32()});
|
||||
DWOTUSection.append(Contents.slice(C->Offset, C->Offset + C->Length).str());
|
||||
TUContributionsToCU.push_back({TUSignature, C->Length});
|
||||
}
|
||||
return DWOTUSection;
|
||||
}
|
||||
@@ -1355,12 +1354,11 @@ static void extractTypesFromDWPDWARF5(
|
||||
llvm::sort(TUContributions,
|
||||
[](const DWARFUnitIndex::Entry::SectionContribution *V1,
|
||||
const DWARFUnitIndex::Entry::SectionContribution *V2) -> bool {
|
||||
return V1->getOffset() < V2->getOffset();
|
||||
return V1->Offset < V2->Offset;
|
||||
});
|
||||
Streamer.switchSection(MCOFI.getDwarfInfoDWOSection());
|
||||
for (const auto *C : TUContributions)
|
||||
Streamer.emitBytes(
|
||||
Contents.slice(C->getOffset(), C->getOffset() + C->getLength()));
|
||||
Streamer.emitBytes(Contents.slice(C->Offset, C->Offset + C->Length));
|
||||
}
|
||||
|
||||
void DWARFRewriter::writeDWP(
|
||||
@@ -1509,10 +1507,9 @@ void DWARFRewriter::writeDWP(
|
||||
Streamer->emitBytes(OutData);
|
||||
auto Index =
|
||||
getContributionIndex(SectionIter->second.second, IndexVersion);
|
||||
CurEntry.Contributions[Index].setOffset(ContributionOffsets[Index]);
|
||||
CurEntry.Contributions[Index].setLength(OutData.size());
|
||||
ContributionOffsets[Index] +=
|
||||
CurEntry.Contributions[Index].getLength32();
|
||||
CurEntry.Contributions[Index].Offset = ContributionOffsets[Index];
|
||||
CurEntry.Contributions[Index].Length = OutData.size();
|
||||
ContributionOffsets[Index] += CurEntry.Contributions[Index].Length;
|
||||
}
|
||||
|
||||
// Strings are combined in to a new string section, and de-duplicated
|
||||
@@ -1541,10 +1538,9 @@ void DWARFRewriter::writeDWP(
|
||||
for (const TUContribution &TUC : TUContributionsToCU) {
|
||||
UnitIndexEntry TUEntry = CurEntry;
|
||||
TUEntry.Contributions[0] = {};
|
||||
TUEntry.Contributions[Index].setOffset(ContributionOffsets[Index]);
|
||||
TUEntry.Contributions[Index].setLength(TUC.Length);
|
||||
ContributionOffsets[Index] +=
|
||||
TUEntry.Contributions[Index].getLength32();
|
||||
TUEntry.Contributions[Index].Offset = ContributionOffsets[Index];
|
||||
TUEntry.Contributions[Index].Length = TUC.Length;
|
||||
ContributionOffsets[Index] += TUEntry.Contributions[Index].Length;
|
||||
TypeIndexEntries.insert(std::make_pair(TUC.Signature, TUEntry));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ void DWARFUnit::SetDwoStrOffsetsBase() {
|
||||
if (const llvm::DWARFUnitIndex::Entry *entry = m_header.GetIndexEntry()) {
|
||||
if (const auto *contribution =
|
||||
entry->getContribution(llvm::DW_SECT_STR_OFFSETS))
|
||||
baseOffset = contribution->getOffset32();
|
||||
baseOffset = contribution->Offset;
|
||||
else
|
||||
return;
|
||||
}
|
||||
@@ -483,7 +483,7 @@ void DWARFUnit::SetLoclistsBase(dw_addr_t loclists_base) {
|
||||
*GetDWOId());
|
||||
return;
|
||||
}
|
||||
offset += contribution->getOffset32();
|
||||
offset += contribution->Offset;
|
||||
}
|
||||
m_loclists_base = loclists_base;
|
||||
|
||||
@@ -521,8 +521,8 @@ DWARFDataExtractor DWARFUnit::GetLocationData() const {
|
||||
if (const llvm::DWARFUnitIndex::Entry *entry = m_header.GetIndexEntry()) {
|
||||
if (const auto *contribution = entry->getContribution(
|
||||
GetVersion() >= 5 ? llvm::DW_SECT_LOCLISTS : llvm::DW_SECT_EXT_LOC))
|
||||
return DWARFDataExtractor(data, contribution->getOffset32(),
|
||||
contribution->getLength32());
|
||||
return DWARFDataExtractor(data, contribution->Offset,
|
||||
contribution->Length);
|
||||
return DWARFDataExtractor();
|
||||
}
|
||||
return data;
|
||||
@@ -534,8 +534,8 @@ DWARFDataExtractor DWARFUnit::GetRnglistData() const {
|
||||
if (const llvm::DWARFUnitIndex::Entry *entry = m_header.GetIndexEntry()) {
|
||||
if (const auto *contribution =
|
||||
entry->getContribution(llvm::DW_SECT_RNGLISTS))
|
||||
return DWARFDataExtractor(data, contribution->getOffset32(),
|
||||
contribution->getLength32());
|
||||
return DWARFDataExtractor(data, contribution->Offset,
|
||||
contribution->Length);
|
||||
GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
|
||||
"Failed to find range list contribution for CU with signature "
|
||||
"0x%" PRIx64,
|
||||
@@ -916,7 +916,7 @@ DWARFUnitHeader::extract(const DWARFDataExtractor &data,
|
||||
"Package unit with a non-zero abbreviation offset");
|
||||
}
|
||||
auto *unit_contrib = header.m_index_entry->getContribution();
|
||||
if (!unit_contrib || unit_contrib->getLength32() != header.m_length + 4) {
|
||||
if (!unit_contrib || unit_contrib->Length != header.m_length + 4) {
|
||||
return llvm::createStringError(llvm::inconvertibleErrorCode(),
|
||||
"Inconsistent DWARF package unit index");
|
||||
}
|
||||
@@ -927,7 +927,7 @@ DWARFUnitHeader::extract(const DWARFDataExtractor &data,
|
||||
llvm::inconvertibleErrorCode(),
|
||||
"DWARF package index missing abbreviation column");
|
||||
}
|
||||
header.m_abbr_offset = abbr_entry->getOffset32();
|
||||
header.m_abbr_offset = abbr_entry->Offset;
|
||||
}
|
||||
|
||||
bool length_OK = data.ValidOffset(header.GetNextUnitOffset() - 1);
|
||||
|
||||
@@ -41,7 +41,7 @@ DWARFCompileUnit *SymbolFileDWARFDwo::GetDWOCompileUnitForHash(uint64_t hash) {
|
||||
if (auto *unit_contrib = entry->getContribution())
|
||||
return llvm::dyn_cast_or_null<DWARFCompileUnit>(
|
||||
DebugInfo().GetUnitAtOffset(DIERef::Section::DebugInfo,
|
||||
unit_contrib->getOffset32()));
|
||||
unit_contrib->Offset));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -536,7 +536,7 @@ public:
|
||||
uint32_t getLineTableOffset() const {
|
||||
if (auto IndexEntry = Header.getIndexEntry())
|
||||
if (const auto *Contrib = IndexEntry->getContribution(DW_SECT_LINE))
|
||||
return Contrib->getOffset32();
|
||||
return Contrib->Offset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,33 +110,9 @@ class DWARFUnitIndex {
|
||||
public:
|
||||
class Entry {
|
||||
public:
|
||||
class SectionContribution {
|
||||
private:
|
||||
uint64_t Fields[2];
|
||||
|
||||
public:
|
||||
static constexpr unsigned OffsetFieldIndex = 0;
|
||||
static constexpr unsigned LengthFieldIndex = 1;
|
||||
SectionContribution() { memset(&Fields, 0, sizeof(Fields)); }
|
||||
SectionContribution(uint64_t Offset, uint64_t Length) {
|
||||
Fields[OffsetFieldIndex] = Offset;
|
||||
Fields[LengthFieldIndex] = Length;
|
||||
}
|
||||
|
||||
void setField(unsigned Index, uint64_t Value) { Fields[Index] = Value; }
|
||||
void setOffset(uint64_t Value) { Fields[OffsetFieldIndex] = Value; }
|
||||
void setLength(uint64_t Value) { Fields[LengthFieldIndex] = Value; }
|
||||
uint64_t getField32(unsigned Index) const {
|
||||
return (uint32_t)Fields[Index];
|
||||
}
|
||||
uint64_t getOffset() const { return Fields[OffsetFieldIndex]; }
|
||||
uint64_t getLength() const { return Fields[LengthFieldIndex]; }
|
||||
uint32_t getOffset32() const {
|
||||
return (uint32_t)Fields[OffsetFieldIndex];
|
||||
}
|
||||
uint32_t getLength32() const {
|
||||
return (uint32_t)Fields[LengthFieldIndex];
|
||||
}
|
||||
struct SectionContribution {
|
||||
uint32_t Offset;
|
||||
uint32_t Length;
|
||||
};
|
||||
|
||||
private:
|
||||
@@ -184,7 +160,7 @@ public:
|
||||
|
||||
uint32_t getVersion() const { return Header.Version; }
|
||||
|
||||
const Entry *getFromOffset(uint64_t Offset) const;
|
||||
const Entry *getFromOffset(uint32_t Offset) const;
|
||||
const Entry *getFromHash(uint64_t Offset) const;
|
||||
|
||||
ArrayRef<DWARFSectionKind> getColumnKinds() const {
|
||||
|
||||
@@ -175,7 +175,7 @@ static StringRef getSubsection(StringRef Section,
|
||||
const auto *Off = Entry.getContribution(Kind);
|
||||
if (!Off)
|
||||
return StringRef();
|
||||
return Section.substr(Off->getOffset(), Off->getLength());
|
||||
return Section.substr(Off->Offset, Off->Length);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -200,17 +200,16 @@ addAllTypesFromDWP(MCStreamer &Out,
|
||||
continue;
|
||||
auto &C =
|
||||
Entry.Contributions[getContributionIndex(Kind, TUIndex.getVersion())];
|
||||
C.setOffset(C.getOffset() + I->getOffset());
|
||||
C.setLength(I->getLength());
|
||||
C.Offset += I->Offset;
|
||||
C.Length = I->Length;
|
||||
++I;
|
||||
}
|
||||
auto &C = Entry.Contributions[TypesContributionIndex];
|
||||
Out.emitBytes(Types.substr(
|
||||
C.getOffset() -
|
||||
TUEntry.Contributions[TypesContributionIndex].getOffset(),
|
||||
C.getLength()));
|
||||
C.setOffset(TypesOffset);
|
||||
TypesOffset += C.getLength();
|
||||
C.Offset - TUEntry.Contributions[TypesContributionIndex].Offset,
|
||||
C.Length));
|
||||
C.Offset = TypesOffset;
|
||||
TypesOffset += C.Length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,23 +226,23 @@ static void addAllTypesFromTypesSection(
|
||||
// Zero out the debug_info contribution
|
||||
Entry.Contributions[0] = {};
|
||||
auto &C = Entry.Contributions[getContributionIndex(DW_SECT_EXT_TYPES, 2)];
|
||||
C.setOffset(TypesOffset);
|
||||
C.Offset = TypesOffset;
|
||||
auto PrevOffset = Offset;
|
||||
// Length of the unit, including the 4 byte length field.
|
||||
C.setLength(Data.getU32(&Offset) + 4);
|
||||
C.Length = Data.getU32(&Offset) + 4;
|
||||
|
||||
Data.getU16(&Offset); // Version
|
||||
Data.getU32(&Offset); // Abbrev offset
|
||||
Data.getU8(&Offset); // Address size
|
||||
auto Signature = Data.getU64(&Offset);
|
||||
Offset = PrevOffset + C.getLength32();
|
||||
Offset = PrevOffset + C.Length;
|
||||
|
||||
auto P = TypeIndexEntries.insert(std::make_pair(Signature, Entry));
|
||||
if (!P.second)
|
||||
continue;
|
||||
|
||||
Out.emitBytes(Types.substr(PrevOffset, C.getLength32()));
|
||||
TypesOffset += C.getLength32();
|
||||
Out.emitBytes(Types.substr(PrevOffset, C.Length));
|
||||
TypesOffset += C.Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -403,13 +402,14 @@ void writeStringsAndOffsets(MCStreamer &Out, DWPStringPool &Strings,
|
||||
}
|
||||
}
|
||||
|
||||
void writeIndexTable(MCStreamer &Out, ArrayRef<unsigned> ContributionOffsets,
|
||||
const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
|
||||
unsigned Index) {
|
||||
void writeIndexTable(
|
||||
MCStreamer &Out, ArrayRef<unsigned> ContributionOffsets,
|
||||
const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
|
||||
uint32_t DWARFUnitIndex::Entry::SectionContribution::*Field) {
|
||||
for (const auto &E : IndexEntries)
|
||||
for (size_t I = 0; I != std::size(E.second.Contributions); ++I)
|
||||
if (ContributionOffsets[I])
|
||||
Out.emitIntValue((E.second.Contributions[I].getField32(Index)), 4);
|
||||
Out.emitIntValue(E.second.Contributions[I].*Field, 4);
|
||||
}
|
||||
|
||||
void writeIndex(MCStreamer &Out, MCSection *Section,
|
||||
@@ -461,11 +461,11 @@ void writeIndex(MCStreamer &Out, MCSection *Section,
|
||||
|
||||
// Write the offsets.
|
||||
writeIndexTable(Out, ContributionOffsets, IndexEntries,
|
||||
DWARFUnitIndex::Entry::SectionContribution::OffsetFieldIndex);
|
||||
&DWARFUnitIndex::Entry::SectionContribution::Offset);
|
||||
|
||||
// Write the lengths.
|
||||
writeIndexTable(Out, ContributionOffsets, IndexEntries,
|
||||
DWARFUnitIndex::Entry::SectionContribution::LengthFieldIndex);
|
||||
&DWARFUnitIndex::Entry::SectionContribution::Length);
|
||||
}
|
||||
|
||||
Error buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
|
||||
@@ -642,9 +642,9 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
|
||||
for (auto Pair : SectionLength) {
|
||||
auto Index = getContributionIndex(Pair.first, IndexVersion);
|
||||
CurEntry.Contributions[Index].setOffset(ContributionOffsets[Index]);
|
||||
CurEntry.Contributions[Index].setLength(Pair.second);
|
||||
ContributionOffsets[Index] += CurEntry.Contributions[Index].getLength32();
|
||||
CurEntry.Contributions[Index].Offset = ContributionOffsets[Index];
|
||||
ContributionOffsets[Index] +=
|
||||
(CurEntry.Contributions[Index].Length = Pair.second);
|
||||
}
|
||||
|
||||
uint32_t &InfoSectionOffset =
|
||||
@@ -664,21 +664,21 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
UnitIndexEntry Entry = CurEntry;
|
||||
auto &C = Entry.Contributions[getContributionIndex(DW_SECT_INFO,
|
||||
IndexVersion)];
|
||||
C.setOffset(InfoSectionOffset);
|
||||
C.setLength(Header.Length + 4);
|
||||
C.Offset = InfoSectionOffset;
|
||||
C.Length = Header.Length + 4;
|
||||
|
||||
if (std::numeric_limits<uint32_t>::max() - InfoSectionOffset <
|
||||
C.getLength32())
|
||||
C.Length)
|
||||
return make_error<DWPError>(
|
||||
"debug information section offset is greater than 4GB");
|
||||
|
||||
UnitOffset += C.getLength32();
|
||||
UnitOffset += C.Length;
|
||||
if (Header.Version < 5 ||
|
||||
Header.UnitType == dwarf::DW_UT_split_compile) {
|
||||
Expected<CompileUnitIdentifiers> EID = getCUIdentifiers(
|
||||
Header, AbbrevSection,
|
||||
Info.substr(UnitOffset - C.getLength32(), C.getLength32()),
|
||||
CurStrOffsetSection, CurStrSection);
|
||||
Expected<CompileUnitIdentifiers> EID =
|
||||
getCUIdentifiers(Header, AbbrevSection,
|
||||
Info.substr(UnitOffset - C.Length, C.Length),
|
||||
CurStrOffsetSection, CurStrSection);
|
||||
|
||||
if (!EID)
|
||||
return createFileError(Input, EID.takeError());
|
||||
@@ -696,9 +696,8 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
if (!P.second)
|
||||
continue;
|
||||
}
|
||||
Out.emitBytes(
|
||||
Info.substr(UnitOffset - C.getLength32(), C.getLength32()));
|
||||
InfoSectionOffset += C.getLength32();
|
||||
Out.emitBytes(Info.substr(UnitOffset - C.Length, C.Length));
|
||||
InfoSectionOffset += C.Length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -761,15 +760,15 @@ Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
|
||||
continue;
|
||||
auto &C =
|
||||
NewEntry.Contributions[getContributionIndex(Kind, IndexVersion)];
|
||||
C.setOffset(C.getOffset() + I->getOffset());
|
||||
C.setLength(I->getLength());
|
||||
C.Offset += I->Offset;
|
||||
C.Length = I->Length;
|
||||
++I;
|
||||
}
|
||||
unsigned Index = getContributionIndex(DW_SECT_INFO, IndexVersion);
|
||||
auto &C = NewEntry.Contributions[Index];
|
||||
Out.emitBytes(CUInfoSection);
|
||||
C.setOffset(InfoSectionOffset);
|
||||
InfoSectionOffset += C.getLength32();
|
||||
C.Offset = InfoSectionOffset;
|
||||
InfoSectionOffset += C.Length;
|
||||
}
|
||||
|
||||
if (!CurTUIndexSection.empty()) {
|
||||
|
||||
@@ -160,11 +160,11 @@ DWARFUnitVector::getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) {
|
||||
if (!CUOff)
|
||||
return nullptr;
|
||||
|
||||
uint64_t Offset = CUOff->getOffset();
|
||||
auto Offset = CUOff->Offset;
|
||||
auto end = begin() + getNumInfoUnits();
|
||||
|
||||
auto *CU =
|
||||
std::upper_bound(begin(), end, CUOff->getOffset(),
|
||||
std::upper_bound(begin(), end, CUOff->Offset,
|
||||
[](uint64_t LHS, const std::unique_ptr<DWARFUnit> &RHS) {
|
||||
return LHS < RHS->getNextUnitOffset();
|
||||
});
|
||||
@@ -353,12 +353,12 @@ bool DWARFUnitHeader::applyIndexEntry(const DWARFUnitIndex::Entry *Entry) {
|
||||
return false;
|
||||
auto *UnitContrib = IndexEntry->getContribution();
|
||||
if (!UnitContrib ||
|
||||
UnitContrib->getLength() != (getLength() + getUnitLengthFieldByteSize()))
|
||||
UnitContrib->Length != (getLength() + getUnitLengthFieldByteSize()))
|
||||
return false;
|
||||
auto *AbbrEntry = IndexEntry->getContribution(DW_SECT_ABBREV);
|
||||
if (!AbbrEntry)
|
||||
return false;
|
||||
AbbrOffset = AbbrEntry->getOffset();
|
||||
AbbrOffset = AbbrEntry->Offset;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ Error DWARFUnit::tryExtractDIEsIfNeeded(bool CUDieOnly) {
|
||||
uint64_t ContributionBaseOffset = 0;
|
||||
if (auto *IndexEntry = Header.getIndexEntry())
|
||||
if (auto *Contrib = IndexEntry->getContribution(DW_SECT_RNGLISTS))
|
||||
ContributionBaseOffset = Contrib->getOffset();
|
||||
ContributionBaseOffset = Contrib->Offset;
|
||||
setRangesSection(
|
||||
&Context.getDWARFObj().getRnglistsDWOSection(),
|
||||
ContributionBaseOffset +
|
||||
@@ -565,7 +565,7 @@ Error DWARFUnit::tryExtractDIEsIfNeeded(bool CUDieOnly) {
|
||||
if (auto *IndexEntry = Header.getIndexEntry())
|
||||
if (const auto *C = IndexEntry->getContribution(
|
||||
Header.getVersion() >= 5 ? DW_SECT_LOCLISTS : DW_SECT_EXT_LOC))
|
||||
Data = Data.substr(C->getOffset(), C->getLength());
|
||||
Data = Data.substr(C->Offset, C->Length);
|
||||
|
||||
DWARFDataExtractor DWARFData(Data, IsLittleEndian, getAddressByteSize());
|
||||
LocTable =
|
||||
@@ -1156,7 +1156,7 @@ DWARFUnit::determineStringOffsetsTableContributionDWO(DWARFDataExtractor &DA) {
|
||||
const auto *C =
|
||||
IndexEntry ? IndexEntry->getContribution(DW_SECT_STR_OFFSETS) : nullptr;
|
||||
if (C)
|
||||
Offset = C->getOffset();
|
||||
Offset = C->Offset;
|
||||
if (getVersion() >= 5) {
|
||||
if (DA.getData().data() == nullptr)
|
||||
return std::nullopt;
|
||||
@@ -1172,7 +1172,7 @@ DWARFUnit::determineStringOffsetsTableContributionDWO(DWARFDataExtractor &DA) {
|
||||
// the length of the string offsets section.
|
||||
StrOffsetsContributionDescriptor Desc;
|
||||
if (C)
|
||||
Desc = StrOffsetsContributionDescriptor(C->getOffset(), C->getLength(), 4,
|
||||
Desc = StrOffsetsContributionDescriptor(C->Offset, C->Length, 4,
|
||||
Header.getFormat());
|
||||
else if (!IndexEntry && !StringOffsetSection.Data.empty())
|
||||
Desc = StrOffsetsContributionDescriptor(0, StringOffsetSection.Data.size(),
|
||||
|
||||
@@ -181,14 +181,14 @@ bool DWARFUnitIndex::parseImpl(DataExtractor IndexData) {
|
||||
for (unsigned i = 0; i != Header.NumUnits; ++i) {
|
||||
auto *Contrib = Contribs[i];
|
||||
for (unsigned i = 0; i != Header.NumColumns; ++i)
|
||||
Contrib[i].setOffset(IndexData.getU32(&Offset));
|
||||
Contrib[i].Offset = IndexData.getU32(&Offset);
|
||||
}
|
||||
|
||||
// Read Table of Section Sizes
|
||||
for (unsigned i = 0; i != Header.NumUnits; ++i) {
|
||||
auto *Contrib = Contribs[i];
|
||||
for (unsigned i = 0; i != Header.NumColumns; ++i)
|
||||
Contrib[i].setLength(IndexData.getU32(&Offset));
|
||||
Contrib[i].Length = IndexData.getU32(&Offset);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -222,21 +222,13 @@ void DWARFUnitIndex::dump(raw_ostream &OS) const {
|
||||
DWARFSectionKind Kind = ColumnKinds[i];
|
||||
StringRef Name = getColumnHeader(Kind);
|
||||
if (!Name.empty())
|
||||
OS << ' '
|
||||
<< left_justify(Name,
|
||||
Kind == DWARFSectionKind::DW_SECT_INFO ? 40 : 24);
|
||||
OS << ' ' << left_justify(Name, 24);
|
||||
else
|
||||
OS << format(" Unknown: %-15" PRIu32, RawSectionIds[i]);
|
||||
}
|
||||
OS << "\n----- ------------------";
|
||||
for (unsigned i = 0; i != Header.NumColumns; ++i) {
|
||||
DWARFSectionKind Kind = ColumnKinds[i];
|
||||
if (Kind == DWARFSectionKind::DW_SECT_INFO ||
|
||||
Kind == DWARFSectionKind::DW_SECT_EXT_TYPES)
|
||||
OS << " ----------------------------------------";
|
||||
else
|
||||
OS << " ------------------------";
|
||||
}
|
||||
for (unsigned i = 0; i != Header.NumColumns; ++i)
|
||||
OS << " ------------------------";
|
||||
OS << '\n';
|
||||
for (unsigned i = 0; i != Header.NumBuckets; ++i) {
|
||||
auto &Row = Rows[i];
|
||||
@@ -244,16 +236,8 @@ void DWARFUnitIndex::dump(raw_ostream &OS) const {
|
||||
OS << format("%5u 0x%016" PRIx64 " ", i + 1, Row.Signature);
|
||||
for (unsigned i = 0; i != Header.NumColumns; ++i) {
|
||||
auto &Contrib = Contribs[i];
|
||||
DWARFSectionKind Kind = ColumnKinds[i];
|
||||
if (Kind == DWARFSectionKind::DW_SECT_INFO ||
|
||||
Kind == DWARFSectionKind::DW_SECT_EXT_TYPES)
|
||||
OS << format("[0x%016" PRIx64 ", 0x%016" PRIx64 ") ",
|
||||
Contrib.getOffset(),
|
||||
Contrib.getOffset() + Contrib.getLength());
|
||||
else
|
||||
OS << format("[0x%08" PRIx32 ", 0x%08" PRIx32 ") ",
|
||||
Contrib.getOffset(),
|
||||
Contrib.getOffset() + Contrib.getLength());
|
||||
OS << format("[0x%08x, 0x%08x) ", Contrib.Offset,
|
||||
Contrib.Offset + Contrib.Length);
|
||||
}
|
||||
OS << '\n';
|
||||
}
|
||||
@@ -275,25 +259,25 @@ DWARFUnitIndex::Entry::getContribution() const {
|
||||
}
|
||||
|
||||
const DWARFUnitIndex::Entry *
|
||||
DWARFUnitIndex::getFromOffset(uint64_t Offset) const {
|
||||
DWARFUnitIndex::getFromOffset(uint32_t Offset) const {
|
||||
if (OffsetLookup.empty()) {
|
||||
for (uint32_t i = 0; i != Header.NumBuckets; ++i)
|
||||
if (Rows[i].Contributions)
|
||||
OffsetLookup.push_back(&Rows[i]);
|
||||
llvm::sort(OffsetLookup, [&](Entry *E1, Entry *E2) {
|
||||
return E1->Contributions[InfoColumn].getOffset() <
|
||||
E2->Contributions[InfoColumn].getOffset();
|
||||
return E1->Contributions[InfoColumn].Offset <
|
||||
E2->Contributions[InfoColumn].Offset;
|
||||
});
|
||||
}
|
||||
auto I = partition_point(OffsetLookup, [&](Entry *E2) {
|
||||
return E2->Contributions[InfoColumn].getOffset() <= Offset;
|
||||
return E2->Contributions[InfoColumn].Offset <= Offset;
|
||||
});
|
||||
if (I == OffsetLookup.begin())
|
||||
return nullptr;
|
||||
--I;
|
||||
const auto *E = *I;
|
||||
const auto &InfoContrib = E->Contributions[InfoColumn];
|
||||
if ((InfoContrib.getOffset() + InfoContrib.getLength()) <= Offset)
|
||||
if ((InfoContrib.Offset + InfoContrib.Length) <= Offset)
|
||||
return nullptr;
|
||||
return E;
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ unsigned DWARFVerifier::verifyIndex(StringRef Name,
|
||||
DataExtractor D(IndexStr, DCtx.isLittleEndian(), 0);
|
||||
if (!Index.parse(D))
|
||||
return 1;
|
||||
using MapType = IntervalMap<uint64_t, uint64_t>;
|
||||
using MapType = IntervalMap<uint32_t, uint64_t>;
|
||||
MapType::Allocator Alloc;
|
||||
std::vector<std::unique_ptr<MapType>> Sections(Index.getColumnKinds().size());
|
||||
for (const DWARFUnitIndex::Entry &E : Index.getRows()) {
|
||||
@@ -418,20 +418,20 @@ unsigned DWARFVerifier::verifyIndex(StringRef Name,
|
||||
: makeArrayRef(E.getContribution(), 1))) {
|
||||
const DWARFUnitIndex::Entry::SectionContribution &SC = E.value();
|
||||
int Col = E.index();
|
||||
if (SC.getLength() == 0)
|
||||
if (SC.Length == 0)
|
||||
continue;
|
||||
if (!Sections[Col])
|
||||
Sections[Col] = std::make_unique<MapType>(Alloc);
|
||||
auto &M = *Sections[Col];
|
||||
auto I = M.find(SC.getOffset());
|
||||
if (I != M.end() && I.start() < (SC.getOffset() + SC.getLength())) {
|
||||
auto I = M.find(SC.Offset);
|
||||
if (I != M.end() && I.start() < (SC.Offset + SC.Length)) {
|
||||
error() << llvm::formatv(
|
||||
"overlapping index entries for entries {0:x16} "
|
||||
"and {1:x16} for column {2}\n",
|
||||
*I, Sig, toString(Index.getColumnKinds()[Col]));
|
||||
return 1;
|
||||
}
|
||||
M.insert(SC.getOffset(), SC.getOffset() + SC.getLength() - 1, Sig);
|
||||
M.insert(SC.Offset, SC.Offset + SC.Length - 1, Sig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# CHECK-NEXT: version = 2, units = 1, slots = 2
|
||||
# CHECK-EMPTY:
|
||||
# CHECK-NEXT: Index Signature Unknown: 9 INFO
|
||||
# CHECK-NEXT: ----- ------------------ ------------------------ ----------------------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x00001000, 0x00001010) [0x0000000000002000, 0x0000000000002020)
|
||||
# CHECK-NEXT: ----- ------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x00001000, 0x00001010) [0x00002000, 0x00002020)
|
||||
|
||||
.section .debug_cu_index, "", @progbits
|
||||
## Header:
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
# CHECK: .debug_cu_index contents:
|
||||
# CHECK-NEXT: version = 2, units = 1, slots = 2
|
||||
# CHECK-EMPTY:
|
||||
# CHECK-NEXT: Index Signature INFO ABBREV LINE LOC STR_OFFSETS MACINFO MACRO
|
||||
# CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x0000000000001000, 0x0000000000001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040) [0x00005000, 0x00005050) [0x00006000, 0x00006060) [0x00007000, 0x00007070)
|
||||
# CHECK-NEXT: Index Signature INFO ABBREV LINE LOC STR_OFFSETS MACINFO MACRO
|
||||
# CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x00001000, 0x00001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040) [0x00005000, 0x00005050) [0x00006000, 0x00006060) [0x00007000, 0x00007070)
|
||||
|
||||
.section .debug_cu_index, "", @progbits
|
||||
## Header:
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
# CHECK: .debug_tu_index contents:
|
||||
# CHECK-NEXT: version = 2, units = 1, slots = 2
|
||||
# CHECK-EMPTY:
|
||||
# CHECK-NEXT: Index Signature TYPES ABBREV LINE STR_OFFSETS
|
||||
# CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x0000000000001000, 0x0000000000001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040)
|
||||
# CHECK-NEXT: Index Signature TYPES ABBREV LINE STR_OFFSETS
|
||||
# CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x00001000, 0x00001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040)
|
||||
|
||||
.section .debug_tu_index, "", @progbits
|
||||
## Header:
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
# CHECK: .debug_cu_index contents:
|
||||
# CHECK-NEXT: version = 5, units = 1, slots = 2
|
||||
# CHECK-EMPTY:
|
||||
# CHECK-NEXT: Index Signature INFO ABBREV LINE LOCLISTS STR_OFFSETS MACRO RNGLISTS
|
||||
# CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x0000000000001000, 0x0000000000001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040) [0x00005000, 0x00005050) [0x00006000, 0x00006060) [0x00007000, 0x00007070)
|
||||
# CHECK-NEXT: Index Signature INFO ABBREV LINE LOCLISTS STR_OFFSETS MACRO RNGLISTS
|
||||
# CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x00001000, 0x00001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040) [0x00005000, 0x00005050) [0x00006000, 0x00006060) [0x00007000, 0x00007070)
|
||||
|
||||
.section .debug_cu_index, "", @progbits
|
||||
## Header:
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
# CHECK: .debug_tu_index contents:
|
||||
# CHECK-NEXT: version = 5, units = 1, slots = 2
|
||||
# CHECK-EMPTY:
|
||||
# CHECK-NEXT: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
# CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x0000000000001000, 0x0000000000001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040)
|
||||
# CHECK-NEXT: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
# CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
# CHECK-NEXT: 1 0x1100001122222222 [0x00001000, 0x00001010) [0x00002000, 0x00002020) [0x00003000, 0x00003030) [0x00004000, 0x00004040)
|
||||
|
||||
.section .debug_tu_index, "", @progbits
|
||||
## Header:
|
||||
|
||||
@@ -38,17 +38,17 @@ RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s
|
||||
|
||||
; CHECK: .debug_cu_index contents:
|
||||
; CHECK-NEXT: version = 2, units = 2, slots = 16
|
||||
; CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
; CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------
|
||||
; CHECK-NEXT: 3 0xfef104c25502f092 [0x000000000000002d, 0x000000000000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
; CHECK-NEXT: 9 0x03c30756e2d45008 [0x0000000000000000, 0x000000000000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
; CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
; CHECK-NEXT: 3 0xfef104c25502f092 [0x0000002d, 0x0000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
; CHECK-NEXT: 9 0x03c30756e2d45008 [0x00000000, 0x0000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
|
||||
; CHECK: .debug_tu_index contents:
|
||||
; CHECK-NEXT: version = 2, units = 2, slots = 16
|
||||
; CHECK: Index Signature TYPES ABBREV LINE STR_OFFSETS
|
||||
; CHECK-NEXT: ----- ------------------ ---------------------------------------- ------------------------ ------------------------ ------------------------
|
||||
; CHECK-NEXT: 9 0x1d02f3be30cc5688 [0x0000000000000024, 0x0000000000000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
; CHECK-NEXT: 13 0x3875c0e21cda63fc [0x0000000000000000, 0x0000000000000024) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
; CHECK: Index Signature TYPES ABBREV LINE STR_OFFSETS
|
||||
; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
|
||||
; CHECK-NEXT: 9 0x1d02f3be30cc5688 [0x00000024, 0x00000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
; CHECK-NEXT: 13 0x3875c0e21cda63fc [0x00000000, 0x00000024) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
|
||||
; TODO: use the index section offset info to correctly dump strings in debug info
|
||||
; TODO: use the index section offset info to correctly dump file names in debug info
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
# CHECK-DAG: .debug_cu_index contents:
|
||||
# CHECK-NEXT: version = 5, units = 1, slots = 2
|
||||
# CHECK: Index Signature INFO ABBREV STR_OFFSETS MACRO
|
||||
# CHECK: 1 0x0000000000000000 [0x0000000000000000, 0x0000000000000019) [0x00000000, 0x00000008) [0x00000000, 0x0000000c) [0x00000000, 0x0000000b)
|
||||
# CHECK: Index Signature INFO ABBREV STR_OFFSETS MACRO
|
||||
# CHECK: 1 0x0000000000000000 [0x00000000, 0x00000019) [0x00000000, 0x00000008) [0x00000000, 0x0000000c) [0x00000000, 0x0000000b)
|
||||
|
||||
.section .debug_info.dwo,"e",@progbits
|
||||
.long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
# CHECK-DAG: .debug_cu_index contents:
|
||||
# CHECK: version = 5, units = 1, slots = 2
|
||||
# CHECK: Index Signature INFO ABBREV
|
||||
# CHECK: 1 [[DWOID]] [0x0000000000000000, 0x0000000000000054) [0x00000000, 0x0000002a)
|
||||
# CHECK: Index Signature INFO ABBREV
|
||||
# CHECK: 1 [[DWOID]] [0x00000000, 0x00000054) [0x00000000, 0x0000002a)
|
||||
|
||||
.section .debug_info.dwo,"e",@progbits
|
||||
.long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
# CHECK-NEXT: DW_LLE_offset_pair (0x0000000000000004, 0x0000000000000008): DW_OP_reg3 RBX
|
||||
|
||||
# CHECK-DAG: .debug_cu_index contents:
|
||||
# CHECK: Index Signature INFO ABBREV LOCLISTS
|
||||
# CHECK: 1 {{.*}} [0x0000000000000018, 0x000000000000002d) [0x00000000, 0x00000004) [0x00000000, 0x0000001d)
|
||||
# CHECK: Index Signature INFO ABBREV LOCLISTS
|
||||
# CHECK: 1 {{.*}} [0x00000018, 0x0000002d) [0x00000000, 0x00000004) [0x00000000, 0x0000001d)
|
||||
|
||||
# CHECK-DAG: .debug_tu_index contents:
|
||||
# CHECK: Index Signature INFO ABBREV LOCLISTS
|
||||
# CHECK: 2 {{.*}} [0x0000000000000000, 0x0000000000000018) [0x00000000, 0x00000004) [0x00000000, 0x0000001d)
|
||||
# CHECK: Index Signature INFO ABBREV LOCLISTS
|
||||
# CHECK: 2 {{.*}} [0x00000000, 0x00000018) [0x00000000, 0x00000004) [0x00000000, 0x0000001d)
|
||||
|
||||
.section .debug_info.dwo,"e",@progbits
|
||||
.long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
|
||||
|
||||
@@ -26,21 +26,21 @@ CHECK-LABEL: Abbrev table for offset:
|
||||
CHECK: 0x0000[[BAOFF:.*]]
|
||||
|
||||
CHECK: .debug_info.dwo contents:
|
||||
CHECK: 0x[[#%.8x,COFF:]]:
|
||||
CHECK: [[COFF:0x[0-9a-f]*]]:
|
||||
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
|
||||
CHECK: 0x[[CAOFF]], addr_size = 0x08 (next unit at 0x[[#%.8x,AOFF:]])
|
||||
CHECK: 0x[[CAOFF]], addr_size = 0x08 (next unit at [[AOFF:.*]])
|
||||
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOC:.*]])
|
||||
CHECK: [[#AOFF]]:
|
||||
CHECK: [[AOFF]]:
|
||||
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
|
||||
CHECK: 0x[[AAOFF]], addr_size = 0x08 (next unit at 0x[[#%.8x,BOFF:]])
|
||||
CHECK: 0x[[AAOFF]], addr_size = 0x08 (next unit at [[BOFF:.*]])
|
||||
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOA:.*]])
|
||||
CHECK: [[#BOFF]]:
|
||||
CHECK: [[BOFF]]:
|
||||
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
|
||||
CHECK: 0x[[BAOFF]], addr_size = 0x08 (next unit at 0x[[#%.8x,XOFF:]])
|
||||
CHECK: 0x[[BAOFF]], addr_size = 0x08 (next unit at [[XOFF:.*]])
|
||||
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOB:.*]])
|
||||
|
||||
CHECK-LABEL: .debug_cu_index
|
||||
CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
CHECK-DAG: [[DWOC]] [0x00000000[[#COFF]], 0x00000000[[#AOFF]]) [0x0000[[CAOFF]], 0x0000[[AAOFF]]) [0x00000000, 0x00000011) [0x00000000, 0x00000018)
|
||||
CHECK-DAG: [[DWOA]] [0x00000000[[#AOFF]], 0x00000000[[#BOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000011, 0x00000022) [0x00000018, 0x00000028)
|
||||
CHECK-DAG: [[DWOB]] [0x00000000[[#BOFF]], 0x00000000[[#XOFF]]) [0x0000[[BAOFF]], 0x000000c3) [0x00000022, 0x00000033) [0x00000028, 0x0000003c)
|
||||
CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
CHECK-DAG: [[DWOC]] [[[COFF]], [[AOFF]]) [0x0000[[CAOFF]], 0x0000[[AAOFF]]) [0x00000000, 0x00000011) [0x00000000, 0x00000018)
|
||||
CHECK-DAG: [[DWOA]] [[[AOFF]], [[BOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000011, 0x00000022) [0x00000018, 0x00000028)
|
||||
CHECK-DAG: [[DWOB]] [[[BOFF]], [[XOFF]]) [0x0000[[BAOFF]], 0x000000c3) [0x00000022, 0x00000033) [0x00000028, 0x0000003c)
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
# RUN: llvm-dwarfdump -debug-rnglists -debug-cu-index -debug-tu-index %t.dwp | FileCheck %s
|
||||
|
||||
# CHECK-DAG: .debug_cu_index contents:
|
||||
# CHECK: Index Signature INFO ABBREV RNGLISTS
|
||||
# CHECK: 1 {{.*}} [0x0000000000000018, 0x000000000000002d) [0x00000000, 0x00000004) [0x00000000, 0x00000017)
|
||||
# CHECK: Index Signature INFO ABBREV RNGLISTS
|
||||
# CHECK: 1 {{.*}} [0x00000018, 0x0000002d) [0x00000000, 0x00000004) [0x00000000, 0x00000017)
|
||||
|
||||
# CHECK-DAG: .debug_tu_index contents:
|
||||
# CHECK: Index Signature INFO ABBREV RNGLISTS
|
||||
# CHECK: 2 {{.*}} [0x0000000000000000, 0x0000000000000018) [0x00000000, 0x00000004) [0x00000000, 0x00000017)
|
||||
# CHECK: Index Signature INFO ABBREV RNGLISTS
|
||||
# CHECK: 2 {{.*}} [0x00000000, 0x00000018) [0x00000000, 0x00000004) [0x00000000, 0x00000017)
|
||||
|
||||
# CHECK-DAG: .debug_rnglists.dwo contents:
|
||||
# range list header: length = 0x00000013, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
|
||||
|
||||
@@ -28,9 +28,9 @@ CHECK: DW_TAG_subprogram
|
||||
CHECK: DW_TAG_formal_parameter
|
||||
|
||||
CHECK: .debug_info.dwo contents:
|
||||
CHECK: 0x[[#%.8x,AOFF:]]:
|
||||
CHECK: [[AOFF:0x[0-9a-f]*]]:
|
||||
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
|
||||
CHECK: 0x[[AAOFF]], addr_size = 0x08 (next unit at 0x[[#%.8x,BOFF:]])
|
||||
CHECK: 0x[[AAOFF]], addr_size = 0x08 (next unit at [[BOFF:.*]])
|
||||
CHECK: DW_TAG_compile_unit
|
||||
CHECK: DW_AT_name {{.*}} "a.cpp"
|
||||
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOA:.*]])
|
||||
@@ -40,9 +40,9 @@ CHECK: DW_TAG_structure_type
|
||||
NOTYP: DW_AT_name {{.*}} "foo"
|
||||
TYPES: DW_AT_signature {{.*}} ([[FOOSIG:.*]])
|
||||
|
||||
CHECK: 0x[[#BOFF]]:
|
||||
CHECK: [[BOFF]]:
|
||||
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
|
||||
CHECK: 0x[[BAOFF]], addr_size = 0x08 (next unit at 0x[[#%.8x,XOFF:]])
|
||||
CHECK: 0x[[BAOFF]], addr_size = 0x08 (next unit at [[XOFF:.*]])
|
||||
CHECK: DW_AT_name {{.*}} "b.cpp"
|
||||
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOB:.*]])
|
||||
CHECK: DW_TAG_structure_type
|
||||
@@ -54,32 +54,32 @@ CHECK: DW_TAG_formal_parameter
|
||||
|
||||
NOTYP-NOT: .debug_types.dwo contents:
|
||||
TYPES-LABEL: .debug_types.dwo contents:
|
||||
TYPES: 0x[[#%.8x,FOOUOFF:]]:
|
||||
TYPES: [[FOOUOFF:0x[0-9a-f]*]]:
|
||||
TYPES-LABEL: Type Unit: length = 0x00000020, format = DWARF32, version = 0x0004, abbr_offset =
|
||||
TYPES: 0x[[AAOFF]], addr_size = 0x08, name = 'foo', type_signature = [[FOOSIG]], type_offset = 0x[[FOOOFF:.*]] (next unit at 0x[[#%.8x,BARUOFF:]])
|
||||
TYPES: 0x[[AAOFF]], addr_size = 0x08, name = 'foo', type_signature = [[FOOSIG]], type_offset = 0x[[FOOOFF:.*]] (next unit at [[BARUOFF:.*]])
|
||||
TYPES: DW_TAG_type_unit
|
||||
TYPES: [[FOOOFF]]: DW_TAG_structure_type
|
||||
TYPES: DW_AT_name {{.*}} "foo"
|
||||
TYPES: 0x[[#BARUOFF]]:
|
||||
TYPES: [[BARUOFF]]:
|
||||
TYPES-LABEL: Type Unit: length = 0x00000020, format = DWARF32, version = 0x0004, abbr_offset =
|
||||
TYPES: 0x[[BAOFF]], addr_size = 0x08, name = 'bar', type_signature = [[BARSIG]], type_offset = 0x001e (next unit at 0x[[#%.8x,XUOFF:]])
|
||||
TYPES: 0x[[BAOFF]], addr_size = 0x08, name = 'bar', type_signature = [[BARSIG]], type_offset = 0x001e (next unit at [[XUOFF:.*]])
|
||||
TYPES: DW_TAG_type_unit
|
||||
TYPES: 0x00000042: DW_TAG_structure_type
|
||||
TYPES: DW_AT_name {{.*}} "bar"
|
||||
|
||||
CHECK-LABEL: .debug_cu_index contents:
|
||||
CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
TYPES: 1 [[DWOA]] [0x00000000[[#AOFF]], 0x00000000[[#BOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
TYPES: 3 [[DWOB]] [0x00000000[[#BOFF]], 0x00000000[[#XOFF]]) [0x0000[[BAOFF]], 0x00000099) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
NOTYP: 3 [[DWOA]] [0x00000000[[#AOFF]], 0x00000000[[#BOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000000, 0x00000011) [0x00000000, 0x00000010)
|
||||
NOTYP: 4 [[DWOB]] [0x00000000[[#BOFF]], 0x00000000[[#XOFF]]) [0x0000[[BAOFF]], 0x00000075) [0x00000011, 0x00000022) [0x00000010, 0x00000024)
|
||||
CHECK: Index Signature INFO ABBREV LINE STR_OFFSETS
|
||||
TYPES: 1 [[DWOA]] [[[AOFF]], [[BOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
TYPES: 3 [[DWOB]] [[[BOFF]], [[XOFF]]) [0x0000[[BAOFF]], 0x00000099) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
NOTYP: 3 [[DWOA]] [[[AOFF]], [[BOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000000, 0x00000011) [0x00000000, 0x00000010)
|
||||
NOTYP: 4 [[DWOB]] [[[BOFF]], [[XOFF]]) [0x0000[[BAOFF]], 0x00000075) [0x00000011, 0x00000022) [0x00000010, 0x00000024)
|
||||
|
||||
Ensure we do not create a debug_tu_index, even an empty or malformed one.
|
||||
NOTYPOBJ-NOT: .debug_tu_index
|
||||
|
||||
TYPES: Index Signature TYPES ABBREV LINE STR_OFFSETS
|
||||
TYPES: 1 [[FOOSIG]] [0x00000000[[#FOOUOFF]], 0x00000000[[#BARUOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
TYPES: 4 [[BARSIG]] [0x00000000[[#BARUOFF]], 0x00000000[[#XUOFF]]) [0x0000[[BAOFF]], 0x00000099) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
TYPES: Index Signature TYPES ABBREV LINE STR_OFFSETS
|
||||
TYPES: 1 [[FOOSIG]] [[[FOOUOFF]], [[BARUOFF]]) [0x0000[[AAOFF]], 0x0000[[BAOFF]]) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
|
||||
TYPES: 4 [[BARSIG]] [[[BARUOFF]], [[XUOFF]]) [0x0000[[BAOFF]], 0x00000099) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
|
||||
|
||||
CHECK-LABEL: .debug_str.dwo contents:
|
||||
CHECK: "clang version
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
# CHECK: 0x0000001b: Type Unit: length = 0x00000017, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_type, abbr_offset = 0x0000, addr_size = 0x08, name = '', type_signature = [[TUID2:.*]], type_offset = 0x0019 (next unit at 0x00000036)
|
||||
# CHECK-DAG: .debug_tu_index contents:
|
||||
# CHECK: version = 5, units = 2, slots = 4
|
||||
# CHECK: Index Signature INFO ABBREV
|
||||
# CHECK: 1 [[TUID1]] [0x0000000000000000, 0x000000000000001b) [0x00000000, 0x00000010)
|
||||
# CHECK: 4 [[TUID2]] [0x000000000000001b, 0x0000000000000036) [0x00000000, 0x00000010)
|
||||
# CHECK: Index Signature INFO ABBREV
|
||||
# CHECK: 1 [[TUID1]] [0x00000000, 0x0000001b) [0x00000000, 0x00000010)
|
||||
# CHECK: 4 [[TUID2]] [0x0000001b, 0x00000036) [0x00000000, 0x00000010)
|
||||
|
||||
.section .debug_info.dwo,"e",@progbits
|
||||
.long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# CHECK: Index Signature INFO ABBREV
|
||||
# CHECK-NOT: Unknown
|
||||
# CHECK: -----
|
||||
# CHECK-NEXT: 1 0x1100002222222222 [0x0000000000000000, 0x0000000000000014) [0x00000000, 0x00000009)
|
||||
# CHECK-NEXT: 1 0x1100002222222222 [0x00000000, 0x00000014) [0x00000000, 0x00000009)
|
||||
# CHECK-NOT: [
|
||||
|
||||
# CHECK: .debug_tu_index contents:
|
||||
@@ -25,7 +25,7 @@
|
||||
# CHECK: Index Signature TYPES ABBREV
|
||||
# CHECK-NOT: Unknown
|
||||
# CHECK: -----
|
||||
# CHECK-NEXT: 2 0x1100003333333333 [0x0000000000000000, 0x0000000000000019) [0x00000009, 0x00000014)
|
||||
# CHECK-NEXT: 2 0x1100003333333333 [0x00000000, 0x00000019) [0x00000009, 0x00000014)
|
||||
# CHECK-NOT: [
|
||||
|
||||
.section .debug_abbrev.dwo, "e", @progbits
|
||||
|
||||
Reference in New Issue
Block a user