In order for the llvm DWARF parser to be used in LLDB we will need to be able to get the parent of a DIE. This patch adds that functionality by changing the DWARFDebugInfoEntry class to store a depth field instead of a sibling index. Using a depth field allows us to easily calculate the sibling and the parent without increasing the size of DWARFDebugInfoEntry.
I tested llvm-dsymutil on a debug version of clang where this fully parses DWARF in over 1200 .o files to verify there was no serious regression in performance.
Added a full suite of unit tests to test this functionality.
Could this accidentally walk into children of another DIE?
(eg: if this is the last child of a DIE - then the next DIE at the same level could be not a sibling, but a child of the following DIE?)
The next DIE at the same level as A1 is B1 (unless the 'null' at the end of A's child list qualifies as the next sibling? But then, if the null is a DIE, what about its next sibling?)
If I read the test case correctly, it's testing CU{int, subprogram{param(i), param(j)}} - so it doesn't test this case where there's a following child at the same level that isn't a sibling. So if it does work, might be good to have a test case for it.