2011-09-13 19:42:23 +00:00
|
|
|
//===-- DWARFCompileUnit.cpp ----------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-01-30 18:07:45 +00:00
|
|
|
#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
|
2011-09-13 19:42:23 +00:00
|
|
|
#include "llvm/Support/Format.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
|
2013-09-23 22:44:40 +00:00
|
|
|
using namespace llvm;
|
2011-09-13 19:42:23 +00:00
|
|
|
|
|
|
|
void DWARFCompileUnit::dump(raw_ostream &OS) {
|
2013-09-23 22:44:40 +00:00
|
|
|
OS << format("0x%08x", getOffset()) << ": Compile Unit:"
|
|
|
|
<< " length = " << format("0x%08x", getLength())
|
|
|
|
<< " version = " << format("0x%04x", getVersion())
|
|
|
|
<< " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset())
|
|
|
|
<< " addr_size = " << format("0x%02x", getAddressByteSize())
|
|
|
|
<< " (next unit at " << format("0x%08x", getNextUnitOffset())
|
2011-09-13 19:42:23 +00:00
|
|
|
<< ")\n";
|
|
|
|
|
2015-05-19 21:54:32 +00:00
|
|
|
if (const DWARFDebugInfoEntryMinimal *CU = getUnitDIE(false))
|
|
|
|
CU->dump(OS, this, -1U);
|
|
|
|
else
|
|
|
|
OS << "<compile unit can't be parsed!>\n\n";
|
2011-09-13 19:42:23 +00:00
|
|
|
}
|
|
|
|
|
2013-09-23 22:44:40 +00:00
|
|
|
// VTable anchor.
|
|
|
|
DWARFCompileUnit::~DWARFCompileUnit() {
|
2013-08-27 09:20:22 +00:00
|
|
|
}
|