48 for (
auto &
Unit : DebugInfo.CompileUnits) {
49 onStartCompileUnit(
Unit);
61 ++FormVal, ++AbbrForm) {
62 onForm(*AbbrForm, *FormVal);
68 case dwarf::DW_FORM_addr:
71 case dwarf::DW_FORM_ref_addr:
74 case dwarf::DW_FORM_exprloc:
75 case dwarf::DW_FORM_block:
76 onValue((uint64_t)FormVal->BlockData.size(),
true);
79 FormVal->BlockData.size()),
82 case dwarf::DW_FORM_block1: {
83 auto writeSize = FormVal->BlockData.size();
84 onValue((uint8_t)writeSize);
87 FormVal->BlockData.size()),
91 case dwarf::DW_FORM_block2: {
92 auto writeSize = FormVal->BlockData.size();
93 onValue((uint16_t)writeSize);
96 FormVal->BlockData.size()),
100 case dwarf::DW_FORM_block4: {
101 auto writeSize = FormVal->BlockData.size();
105 FormVal->BlockData.size()),
109 case dwarf::DW_FORM_data1:
110 case dwarf::DW_FORM_ref1:
111 case dwarf::DW_FORM_flag:
112 case dwarf::DW_FORM_strx1:
113 case dwarf::DW_FORM_addrx1:
114 onValue((uint8_t)FormVal->Value);
116 case dwarf::DW_FORM_data2:
117 case dwarf::DW_FORM_ref2:
118 case dwarf::DW_FORM_strx2:
119 case dwarf::DW_FORM_addrx2:
120 onValue((uint16_t)FormVal->Value);
122 case dwarf::DW_FORM_data4:
123 case dwarf::DW_FORM_ref4:
124 case dwarf::DW_FORM_ref_sup4:
125 case dwarf::DW_FORM_strx4:
126 case dwarf::DW_FORM_addrx4:
129 case dwarf::DW_FORM_data8:
130 case dwarf::DW_FORM_ref8:
131 case dwarf::DW_FORM_ref_sup8:
132 onValue((uint64_t)FormVal->Value);
134 case dwarf::DW_FORM_sdata:
135 onValue((int64_t)FormVal->Value,
true);
137 case dwarf::DW_FORM_udata:
138 case dwarf::DW_FORM_ref_udata:
139 onValue((uint64_t)FormVal->Value,
true);
141 case dwarf::DW_FORM_string:
142 onValue(FormVal->CStr);
144 case dwarf::DW_FORM_indirect:
145 onValue((uint64_t)FormVal->Value,
true);
147 Form =
static_cast<dwarf::Form>((uint64_t)FormVal->Value);
150 case dwarf::DW_FORM_strp:
151 case dwarf::DW_FORM_sec_offset:
152 case dwarf::DW_FORM_GNU_ref_alt:
153 case dwarf::DW_FORM_GNU_strp_alt:
154 case dwarf::DW_FORM_line_strp:
155 case dwarf::DW_FORM_strp_sup:
158 case dwarf::DW_FORM_ref_sig8:
159 onValue((uint64_t)FormVal->Value);
161 case dwarf::DW_FORM_GNU_addr_index:
162 case dwarf::DW_FORM_GNU_str_index:
163 onValue((uint64_t)FormVal->Value,
true);
172 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)