LLVM
3.7.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
work
release_test
rc4
llvm.src
lib
DebugInfo
DWARF
DWARFTypeUnit.cpp
Go to the documentation of this file.
1
//===-- DWARFTypeUnit.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/DWARFTypeUnit.h
"
11
#include "
llvm/Support/Format.h
"
12
#include "
llvm/Support/raw_ostream.h
"
13
14
using namespace
llvm;
15
16
bool
DWARFTypeUnit::extractImpl
(
DataExtractor
debug_info,
17
uint32_t *offset_ptr) {
18
if
(!
DWARFUnit::extractImpl
(debug_info, offset_ptr))
19
return
false
;
20
TypeHash = debug_info.
getU64
(offset_ptr);
21
TypeOffset = debug_info.
getU32
(offset_ptr);
22
return
TypeOffset <
getLength
();
23
}
24
25
void
DWARFTypeUnit::dump
(
raw_ostream
&OS) {
26
OS <<
format
(
"0x%08x"
,
getOffset
()) <<
": Type Unit:"
27
<<
" length = "
<<
format
(
"0x%08x"
,
getLength
())
28
<<
" version = "
<<
format
(
"0x%04x"
,
getVersion
())
29
<<
" abbr_offset = "
<<
format
(
"0x%04x"
,
getAbbreviations
()->
getOffset
())
30
<<
" addr_size = "
<<
format
(
"0x%02x"
,
getAddressByteSize
())
31
<<
" type_signature = "
<<
format
(
"0x%16"
PRIx64, TypeHash)
32
<<
" type_offset = "
<<
format
(
"0x%04x"
, TypeOffset)
33
<<
" (next unit at "
<<
format
(
"0x%08x"
,
getNextUnitOffset
())
34
<<
")\n"
;
35
36
if
(
const
DWARFDebugInfoEntryMinimal
*TU =
getUnitDIE
(
false
))
37
TU->dump(OS,
this
, -1U);
38
else
39
OS <<
"<type unit can't be parsed!>\n\n"
;
40
}
llvm::DWARFUnit::getNextUnitOffset
uint32_t getNextUnitOffset() const
Definition:
DWARFUnit.h:185
llvm::DWARFUnit::getAbbreviations
const DWARFAbbreviationDeclarationSet * getAbbreviations() const
Definition:
DWARFUnit.h:188
llvm::DWARFUnit::getLength
uint32_t getLength() const
Definition:
DWARFUnit.h:186
llvm::DataExtractor::getU32
uint32_t getU32(uint32_t *offset_ptr) const
Extract a uint32_t value from *offset_ptr.
Definition:
DataExtractor.cpp:71
DWARFTypeUnit.h
llvm::DWARFUnit::getVersion
uint16_t getVersion() const
Definition:
DWARFUnit.h:187
llvm::format
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
Definition:
Format.h:111
llvm::DWARFTypeUnit::extractImpl
bool extractImpl(DataExtractor debug_info, uint32_t *offset_ptr) override
Definition:
DWARFTypeUnit.cpp:16
llvm::DWARFTypeUnit::dump
void dump(raw_ostream &OS)
Definition:
DWARFTypeUnit.cpp:25
llvm::DWARFDebugInfoEntryMinimal
DWARFDebugInfoEntryMinimal - A DIE with only the minimum required data.
Definition:
DWARFDebugInfoEntry.h:29
llvm::DataExtractor::getU64
uint64_t getU64(uint32_t *offset_ptr) const
Extract a uint64_t value from *offset_ptr.
Definition:
DataExtractor.cpp:81
llvm::DataExtractor
Definition:
DataExtractor.h:17
Format.h
llvm::DWARFUnit::extractImpl
virtual bool extractImpl(DataExtractor debug_info, uint32_t *offset_ptr)
Definition:
DWARFUnit.cpp:68
llvm::DWARFUnit::getOffset
uint32_t getOffset() const
Definition:
DWARFUnit.h:184
llvm::DWARFUnit::getAddressByteSize
uint8_t getAddressByteSize() const
Definition:
DWARFUnit.h:191
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition:
raw_ostream.h:38
llvm::DWARFUnit::getUnitDIE
const DWARFDebugInfoEntryMinimal * getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition:
DWARFUnit.h:198
raw_ostream.h
Generated on Mon Aug 31 2015 11:00:28 for LLVM by
1.8.6