25 using namespace dwarf;
27 void DWARFAbbreviationDeclaration::clear() {
32 AttributeSpecs.clear();
33 FixedAttributeSize.reset();
49 CodeByteSize = *OffsetPtr -
Offset;
51 if (
Tag == DW_TAG_null) {
55 uint8_t ChildrenByte = Data.
getU8(OffsetPtr);
60 FixedAttributeSize = FixedSizeInfo();
67 bool IsImplicitConst = (
F == DW_FORM_implicit_const);
68 if (IsImplicitConst) {
78 if (FixedAttributeSize)
79 ++FixedAttributeSize->NumAddrs;
82 case DW_FORM_ref_addr:
83 if (FixedAttributeSize)
84 ++FixedAttributeSize->NumRefAddrs;
88 case DW_FORM_GNU_ref_alt:
89 case DW_FORM_GNU_strp_alt:
90 case DW_FORM_line_strp:
91 case DW_FORM_sec_offset:
92 case DW_FORM_strp_sup:
93 if (FixedAttributeSize)
94 ++FixedAttributeSize->NumDwarfOffsets;
101 if (FixedAttributeSize)
102 FixedAttributeSize->NumBytes += *ByteSize;
108 FixedAttributeSize.
reset();
113 }
else if (A == 0 &&
F == 0) {
130 OS <<
'[' << getCode() <<
"] ";
132 OS <<
"\tDW_CHILDREN_" << (hasChildren() ?
"yes" :
"no") <<
'\n';
134 OS <<
formatv(
"\t{0}\t{1}", Spec.Attr, Spec.Form);
135 if (Spec.isImplicitConst())
136 OS <<
'\t' << Spec.getImplicitConstValue();
144 for (
uint32_t i = 0, e = AttributeSpecs.size(); i != e; ++i) {
145 if (AttributeSpecs[i].Attr == Attr)
164 for (
const auto &Spec : AttributeSpecs) {
165 if (*MatchAttrIndex == AttrIndex) {
168 if (Spec.isImplicitConst()) {
169 FormValue.
setSValue(Spec.getImplicitConstValue());
176 if (
auto FixedSize = Spec.getByteSize(U))
177 Offset += *FixedSize;
186 size_t DWARFAbbreviationDeclaration::FixedSizeInfo::getByteSize(
188 size_t ByteSize = NumBytes;
200 if (isImplicitConst())
202 if (ByteSize.HasByteSize)
203 return ByteSize.ByteSize;
213 if (FixedAttributeSize)
214 return FixedAttributeSize->getByteSize(U);
bool extract(DataExtractor Data, uint32_t *OffsetPtr)
This class represents lattice values for constants.
Optional< int64_t > getByteSize(const DWARFUnit &U) const
Get the fixed byte size of this Form if possible.
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
Optional< size_t > getFixedAttributesByteSize(const DWARFUnit &U) const
uint8_t getRefAddrByteSize() const
Optional< uint32_t > findAttributeIndex(dwarf::Attribute attr) const
Get the index of the specified attribute.
const dwarf::FormParams & getFormParams() const
uint8_t getAddressByteSize() const
Optional< DWARFFormValue > getAttributeValue(const uint32_t DIEOffset, const dwarf::Attribute Attr, const DWARFUnit &U) const
Extract a DWARF form value from a DIE specified by DIE offset.
DWARFAbbreviationDeclaration()
unsigned getTag(StringRef TagString)
void dump(raw_ostream &OS) const
This file contains constants used for implementing Dwarf debug support.
static void clear(coro::Shape &Shape)
DWARFDataExtractor getDebugInfoExtractor() const
Optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
This class implements an extremely fast bulk output stream that can only output to a stream...
uint8_t getDwarfOffsetByteSize() const