[PATCH] D28303: Add iterator support to DWARFDie to allow child DIE iteration.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 14:07:33 PST 2017


dblaikie added inline comments.


================
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:1210-1228
+    CUDie.addChild((dwarf::Tag)Tag::A);
+  }
+  
+  MemoryBufferRef FileBuffer(DG->generate(), "dwarf");
+  auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
+  EXPECT_TRUE((bool)Obj);
+  DWARFContextInMemory DwarfContext(*Obj.get());
----------------
I would expect this test case (or the one above (TestChildIterators)) to have a DIE with a zero length children list, rather than the explicit test at the end here which looks more like it's testing the internals of DWARFDie::iterator (that iterator(DWARFDie) ctor should probably not be public and instead only accessible from DWARFDie).

Is there a way to create a test that parses a DIE with a zero-length (but present) child list instead? Perhaps if it's not possible with the DWARF APIs we have, Chris Bieneman's yaml2obj might be up to the task.


https://reviews.llvm.org/D28303





More information about the llvm-commits mailing list