diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-11-12 06:33:14 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-11-12 06:33:14 +0000 |
commit | 6400fc146ed143b98543ae6a86796bc5c9eeb9d8 (patch) | |
tree | e55e860b93437953214f6a5f9ee95d6cc8d5a641 /llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp | |
parent | 9dd55a80655780cc5e38937958106bdb0143e669 (diff) | |
download | bcm5719-llvm-6400fc146ed143b98543ae6a86796bc5c9eeb9d8.tar.gz bcm5719-llvm-6400fc146ed143b98543ae6a86796bc5c9eeb9d8.zip |
Mostly revert 252842 due to failures on some buildbots.
I imagine there's some UB in here somewhere, though Valgrind doesn't
seem to have picked it up (not sure if I have a working asan build right
now to test there).
GDB bot seems to be crashing:
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/26267/steps/check-all/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dwp.test
Hexagon ELF bot is, presumably, just getting different output:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/32927/steps/check-all/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dwp.test
llvm-svn: 252859
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp | 64 |
1 files changed, 5 insertions, 59 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp index 0bb786d7b72..f97a68f860a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp @@ -26,7 +26,10 @@ bool DWARFUnitIndex::Header::parse(DataExtractor IndexData, } void DWARFUnitIndex::Header::dump(raw_ostream &OS) const { - OS << format("version = %u slots = %u\n\n", Version, NumBuckets); + OS << "Index header:\n" << format(" version: %u\n", Version) + << format(" columns: %u\n", NumColumns) + << format(" units: %u\n", NumUnits) + << format(" buckets: %u\n", NumBuckets); } bool DWARFUnitIndex::parse(DataExtractor IndexData) { @@ -39,45 +42,6 @@ bool DWARFUnitIndex::parse(DataExtractor IndexData) { (2 * Header.NumUnits + 1) * 4 * Header.NumColumns)) return false; - Rows = llvm::make_unique<HashRow[]>(Header.NumBuckets); - auto Contribs = - llvm::make_unique<HashRow::SectionContribution *[]>(Header.NumUnits); - ColumnKinds = llvm::make_unique<DwarfSection[]>(Header.NumColumns); - - // Read Hash Table of Signatures - for (unsigned i = 0; i != Header.NumBuckets; ++i) - Rows[i].Signature = IndexData.getU64(&Offset); - - // Read Parallel Table of Indexes - for (unsigned i = 0; i != Header.NumBuckets; ++i) { - auto Index = IndexData.getU32(&Offset); - if (!Index) - continue; - Rows[i].Contributions = - llvm::make_unique<HashRow::SectionContribution[]>(Header.NumColumns); - Contribs[Index - 1] = Rows[i].Contributions.get(); - } - - // Read the Column Headers - for (unsigned i = 0; i != Header.NumColumns; ++i) - ColumnKinds[i] = static_cast<DwarfSection>(IndexData.getU32(&Offset)); - - // Read Table of Section Offsets - for (unsigned i = 0; i != Header.NumUnits; ++i) { - auto *Contrib = Contribs[i]; - for (unsigned i = 0; i != Header.NumColumns; ++i) { - 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].Size = IndexData.getU32(&Offset); - } - } - return true; } @@ -100,24 +64,6 @@ StringRef DWARFUnitIndex::getColumnHeader(DwarfSection DS) { void DWARFUnitIndex::dump(raw_ostream &OS) const { Header.dump(OS); - OS << "Index Signature "; - for (unsigned i = 0; i != Header.NumColumns; ++i) - OS << format(" %-24s", getColumnHeader(ColumnKinds[i])); - OS << "\n----- ------------------"; - for (unsigned i = 0; i != Header.NumColumns; ++i) - OS << " ------------------------"; - OS << '\n'; - for (unsigned i = 0; i != Header.NumBuckets; ++i) { - auto &Row = Rows[i]; - if (auto *Contribs = Row.Contributions.get()) { - OS << format("%5u 0x%016" PRIx64 " ", i, Row.Signature); - for (unsigned i = 0; i != Header.NumColumns; ++i) { - auto &Contrib = Contribs[i]; - OS << format("[0x%08u, 0x%08u) ", Contrib.Offset, - Contrib.Offset + Contrib.Size); - } - OS << '\n'; - } - } } + } |