comparison lib/DebugInfo/DWARF/DWARFCompileUnit.cpp @ 148:63bd29f05246

merged
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 19:46:37 +0900
parents c2174574ed3a
children
comparison
equal deleted inserted replaced
146:3fc4d5c3e21e 148:63bd29f05246
1 //===-- DWARFCompileUnit.cpp ----------------------------------------------===// 1 //===-- DWARFCompileUnit.cpp ----------------------------------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // 4 // See https://llvm.org/LICENSE.txt for license information.
5 // This file is distributed under the University of Illinois Open Source 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // License. See LICENSE.TXT for details.
7 // 6 //
8 //===----------------------------------------------------------------------===// 7 //===----------------------------------------------------------------------===//
9 8
10 #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" 9 #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
11 #include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h" 10 #include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
14 #include "llvm/Support/raw_ostream.h" 13 #include "llvm/Support/raw_ostream.h"
15 14
16 using namespace llvm; 15 using namespace llvm;
17 16
18 void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) { 17 void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
19 OS << format("0x%08x", getOffset()) << ": Compile Unit:" 18 OS << format("0x%08" PRIx64, getOffset()) << ": Compile Unit:"
20 << " length = " << format("0x%08x", getLength()) 19 << " length = " << format("0x%08x", getLength())
21 << " version = " << format("0x%04x", getVersion()); 20 << " version = " << format("0x%04x", getVersion());
22 if (getVersion() >= 5) 21 if (getVersion() >= 5)
23 OS << " unit_type = " << dwarf::UnitTypeString(getUnitType()); 22 OS << " unit_type = " << dwarf::UnitTypeString(getUnitType());
24 OS << " abbr_offset = " << format("0x%04x", getAbbreviations()->getOffset()) 23 OS << " abbr_offset = "
25 << " addr_size = " << format("0x%02x", getAddressByteSize()) 24 << format("0x%04" PRIx64, getAbbreviations()->getOffset())
26 << " (next unit at " << format("0x%08x", getNextUnitOffset()) 25 << " addr_size = " << format("0x%02x", getAddressByteSize());
26 if (getVersion() >= 5 && getUnitType() != dwarf::DW_UT_compile)
27 OS << " DWO_id = " << format("0x%016" PRIx64, *getDWOId());
28 OS << " (next unit at " << format("0x%08" PRIx64, getNextUnitOffset())
27 << ")\n"; 29 << ")\n";
28 30
29 if (DWARFDie CUDie = getUnitDIE(false)) 31 if (DWARFDie CUDie = getUnitDIE(false))
30 CUDie.dump(OS, 0, DumpOpts); 32 CUDie.dump(OS, 0, DumpOpts);
31 else 33 else