LLVM  3.7.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 
11 #include "llvm/Support/Format.h"
13 
14 using namespace llvm;
15 
17  OS << format("0x%08x", getOffset()) << ": Compile Unit:"
18  << " length = " << format("0x%08x", getLength())
19  << " version = " << format("0x%04x", getVersion())
20  << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
21  << " addr_size = " << format("0x%02x", getAddressByteSize())
22  << " (next unit at " << format("0x%08x", getNextUnitOffset())
23  << ")\n";
24 
25  if (const DWARFDebugInfoEntryMinimal *CU = getUnitDIE(false))
26  CU->dump(OS, this, -1U);
27  else
28  OS << "<compile unit can't be parsed!>\n\n";
29 }
30 
31 // VTable anchor.
33 }
uint32_t getNextUnitOffset() const
Definition: DWARFUnit.h:185
const DWARFAbbreviationDeclarationSet * getAbbreviations() const
Definition: DWARFUnit.h:188
uint32_t getLength() const
Definition: DWARFUnit.h:186
uint16_t getVersion() const
Definition: DWARFUnit.h:187
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:111
DWARFDebugInfoEntryMinimal - A DIE with only the minimum required data.
void dump(raw_ostream &OS)
uint32_t getOffset() const
Definition: DWARFUnit.h:184
uint8_t getAddressByteSize() const
Definition: DWARFUnit.h:191
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
const DWARFDebugInfoEntryMinimal * getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition: DWARFUnit.h:198