In order for LLDB to be able to use the LLVM DWARF parser, it needs to be able to iterate across all attributes in a DWARFDie. This change adds a DWARFDie::attributes() function that allows easy iteration:
for (auto &AttrValue : CUDie.attributes()) {
switch (AttrValue.Attr) {
case DW_AT_name:
if (auto Name = AttrValue.Value.getAsCString())
...
break;
case DW_AT_declaration:
if (auto Declaration = AttrValue.Value.getAsUnsignedConstant())
...
break;
case DW_AT_low_pc:
if (auto LowPC = AttrValue.Value.getAsAddress())
...
break;
default:
break;
}
}