Line data Source code
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 :
10 : #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
11 : #include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
12 : #include "llvm/DebugInfo/DWARF/DWARFDie.h"
13 : #include "llvm/Support/Format.h"
14 : #include "llvm/Support/raw_ostream.h"
15 :
16 : using namespace llvm;
17 :
18 671 : void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
19 671 : OS << format("0x%08x", getOffset()) << ": Compile Unit:"
20 671 : << " length = " << format("0x%08x", getLength())
21 671 : << " version = " << format("0x%04x", getVersion());
22 671 : if (getVersion() >= 5)
23 58 : OS << " unit_type = " << dwarf::UnitTypeString(getUnitType());
24 671 : OS << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
25 671 : << " addr_size = " << format("0x%02x", getAddressByteSize());
26 671 : if (getVersion() >= 5 && getUnitType() != dwarf::DW_UT_compile)
27 32 : OS << " DWO_id = " << format("0x%016" PRIx64, *getDWOId());
28 671 : OS << " (next unit at " << format("0x%08x", getNextUnitOffset()) << ")\n";
29 :
30 671 : if (DWARFDie CUDie = getUnitDIE(false))
31 669 : CUDie.dump(OS, 0, DumpOpts);
32 : else
33 2 : OS << "<compile unit can't be parsed!>\n\n";
34 671 : }
35 :
36 : // VTable anchor.
37 : DWARFCompileUnit::~DWARFCompileUnit() = default;
|