2
0

DWARFCompileUnit.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. //===-- DWARFCompileUnit.cpp ----------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
  10. #include "llvm/Support/Format.h"
  11. #include "llvm/Support/raw_ostream.h"
  12. using namespace llvm;
  13. void DWARFCompileUnit::dump(raw_ostream &OS) {
  14. OS << format("0x%08x", getOffset()) << ": Compile Unit:"
  15. << " length = " << format("0x%08x", getLength())
  16. << " version = " << format("0x%04x", getVersion())
  17. << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
  18. << " addr_size = " << format("0x%02x", getAddressByteSize())
  19. << " (next unit at " << format("0x%08x", getNextUnitOffset())
  20. << ")\n";
  21. if (const DWARFDebugInfoEntryMinimal *CU = getUnitDIE(false))
  22. CU->dump(OS, this, -1U);
  23. else
  24. OS << "<compile unit can't be parsed!>\n\n";
  25. }
  26. // VTable anchor.
  27. DWARFCompileUnit::~DWARFCompileUnit() {
  28. }