47 for (
auto &
Unit : DebugInfo.CompileUnits) {
48 onStartCompileUnit(
Unit);
60 ++FormVal, ++AbbrForm) {
61 onForm(*AbbrForm, *FormVal);
67 case dwarf::DW_FORM_addr:
70 case dwarf::DW_FORM_ref_addr:
73 case dwarf::DW_FORM_exprloc:
74 case dwarf::DW_FORM_block:
75 onValue((uint64_t)FormVal->BlockData.size(),
true);
78 FormVal->BlockData.size()),
81 case dwarf::DW_FORM_block1: {
82 auto writeSize = FormVal->BlockData.size();
83 onValue((uint8_t)writeSize);
86 FormVal->BlockData.size()),
90 case dwarf::DW_FORM_block2: {
91 auto writeSize = FormVal->BlockData.size();
92 onValue((uint16_t)writeSize);
95 FormVal->BlockData.size()),
99 case dwarf::DW_FORM_block4: {
100 auto writeSize = FormVal->BlockData.size();
104 FormVal->BlockData.size()),
108 case dwarf::DW_FORM_data1:
109 case dwarf::DW_FORM_ref1:
110 case dwarf::DW_FORM_flag:
111 case dwarf::DW_FORM_strx1:
112 case dwarf::DW_FORM_addrx1:
113 onValue((uint8_t)FormVal->Value);
115 case dwarf::DW_FORM_data2:
116 case dwarf::DW_FORM_ref2:
117 case dwarf::DW_FORM_strx2:
118 case dwarf::DW_FORM_addrx2:
119 onValue((uint16_t)FormVal->Value);
121 case dwarf::DW_FORM_data4:
122 case dwarf::DW_FORM_ref4:
123 case dwarf::DW_FORM_ref_sup4:
124 case dwarf::DW_FORM_strx4:
125 case dwarf::DW_FORM_addrx4:
128 case dwarf::DW_FORM_data8:
129 case dwarf::DW_FORM_ref8:
130 case dwarf::DW_FORM_ref_sup8:
131 onValue((uint64_t)FormVal->Value);
133 case dwarf::DW_FORM_sdata:
134 onValue((int64_t)FormVal->Value,
true);
136 case dwarf::DW_FORM_udata:
137 case dwarf::DW_FORM_ref_udata:
138 onValue((uint64_t)FormVal->Value,
true);
140 case dwarf::DW_FORM_string:
141 onValue(FormVal->CStr);
143 case dwarf::DW_FORM_indirect:
144 onValue((uint64_t)FormVal->Value,
true);
146 Form =
static_cast<dwarf::Form>((uint64_t)FormVal->Value);
149 case dwarf::DW_FORM_strp:
150 case dwarf::DW_FORM_sec_offset:
151 case dwarf::DW_FORM_GNU_ref_alt:
152 case dwarf::DW_FORM_GNU_strp_alt:
153 case dwarf::DW_FORM_line_strp:
154 case dwarf::DW_FORM_strp_sup:
157 case dwarf::DW_FORM_ref_sig8:
158 onValue((uint64_t)FormVal->Value);
160 case dwarf::DW_FORM_GNU_addr_index:
161 case dwarf::DW_FORM_GNU_str_index:
162 onValue((uint64_t)FormVal->Value,
true);
171 onEndCompileUnit(
Unit);
std::vector< AttributeAbbrev > Attributes
This class represents lattice values for constants.
static unsigned getRefSize(const DWARFYAML::Unit &Unit)
std::vector< Entry > Entries
std::vector< FormValue > Values
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A class to visits DWARFYAML Compile Units and DIEs in preorder.
llvm::yaml::Hex32 AbbrCode
This file declares classes for handling the YAML representation of DWARF Debug Info.
StringRef - Represent a constant reference to a string, i.e.
static unsigned getOffsetSize(const DWARFYAML::Unit &Unit)