LLVM  4.0.0
DWARFCompileUnit.cpp
Go to the documentation of this file.
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 
13 #include "llvm/Support/Format.h"
15 
16 using namespace llvm;
17 
19  OS << format("0x%08x", getOffset()) << ": Compile Unit:"
20  << " length = " << format("0x%08x", getLength())
21  << " version = " << format("0x%04x", getVersion())
22  << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
23  << " addr_size = " << format("0x%02x", getAddressByteSize())
24  << " (next unit at " << format("0x%08x", getNextUnitOffset())
25  << ")\n";
26 
27  if (DWARFDie CUDie = getUnitDIE(false))
28  CUDie.dump(OS, -1U);
29  else
30  OS << "<compile unit can't be parsed!>\n\n";
31 }
32 
33 // VTable anchor.
~DWARFCompileUnit() override
uint32_t getNextUnitOffset() const
Definition: DWARFUnit.h:202
const DWARFAbbreviationDeclarationSet * getAbbreviations() const
Definition: DWARFUnit.h:208
uint32_t getLength() const
Definition: DWARFUnit.h:203
uint16_t getVersion() const
Definition: DWARFUnit.h:204
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
Utility class that carries the DWARF compile/type unit and the debug info entry in an object...
Definition: DWARFDie.h:36
void dump(raw_ostream &OS)
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition: DWARFUnit.h:228
uint32_t getOffset() const
Definition: DWARFUnit.h:201
uint8_t getAddressByteSize() const
Definition: DWARFUnit.h:211
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44