DWARF: Improve indentation of DIE dumping so it's easier to see the structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139705 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2011-09-14 17:54:56 +00:00
parent 0d4fea7866
commit 0942255f6d

View File

@ -28,12 +28,12 @@ void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS,
if (debug_info_data.isValidOffset(offset)) { if (debug_info_data.isValidOffset(offset)) {
uint64_t abbrCode = debug_info_data.getULEB128(&offset); uint64_t abbrCode = debug_info_data.getULEB128(&offset);
OS.indent(indent) << format("\n0x%8.8x: ", Offset); OS << format("\n0x%8.8x: ", Offset);
if (abbrCode) { if (abbrCode) {
if (AbbrevDecl) { if (AbbrevDecl) {
OS << TagString(AbbrevDecl->getTag()) OS.indent(indent) << TagString(AbbrevDecl->getTag())
<< format(" [%u] %c\n", abbrCode, << format(" [%u] %c\n", abbrCode,
AbbrevDecl->hasChildren() ? '*': ' '); AbbrevDecl->hasChildren() ? '*': ' ');
// Dump all data in the .debug_info for the attributes // Dump all data in the .debug_info for the attributes
const uint32_t numAttributes = AbbrevDecl->getNumAttributes(); const uint32_t numAttributes = AbbrevDecl->getNumAttributes();
@ -55,7 +55,7 @@ void DWARFDebugInfoEntryMinimal::dump(raw_ostream &OS,
<< abbrCode << '\n'; << abbrCode << '\n';
} }
} else { } else {
OS << "NULL\n"; OS.indent(indent) << "NULL\n";
} }
} }
} }
@ -66,9 +66,9 @@ void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS,
uint16_t attr, uint16_t attr,
uint16_t form, uint16_t form,
unsigned indent) const { unsigned indent) const {
OS.indent(indent) << format("0x%8.8x: ", *offset_ptr) OS << format("0x%8.8x: ", *offset_ptr);
<< AttributeString(attr) OS.indent(indent+2) << AttributeString(attr)
<< " [" << FormEncodingString(form) << ']'; << " [" << FormEncodingString(form) << ']';
DWARFFormValue formValue(form); DWARFFormValue formValue(form);