[PATCH] D63537: [llvm-dwarfdump] --gdb-index: fix uninitialized TuListOffset

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 09:40:05 PDT 2019


dblaikie added inline comments.


================
Comment at: llvm/trunk/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp:141-148
+  uint32_t TuListSize = (AddressAreaOffset - TuListOffset) / 24;
   TuList.resize(TuListSize);
   for (uint32_t I = 0; I < TuListSize; ++I) {
     uint64_t CuOffset = Data.getU64(&Offset);
     uint64_t TypeOffset = Data.getU64(&Offset);
     uint64_t Signature = Data.getU64(&Offset);
     TuList[I] = {CuOffset, TypeOffset, Signature};
----------------
Is this loop still untested (since all the test cases have TuListSize of zero - so the body of this loop could be incorrect & no test would diagnose it? (eg: if you put "assert(false)" in the loop, does it fire?)

For test cases of this feature, you could either construct one by hand writing assembly - or it's possible (& probably better to check the format agrees with gdb) by using gdb to generate the index: https://www-zeuthen.desy.de/unix/unixguide/infohtml/gdb/Index-Files.html 


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63537/new/

https://reviews.llvm.org/D63537





More information about the llvm-commits mailing list