|
LLVM
4.0.0
|
#include <DWARFFormValue.h>
Public Types | |
| enum | FormClass { FC_Unknown, FC_Address, FC_Block, FC_Constant, FC_String, FC_Flag, FC_Reference, FC_Indirect, FC_SectionOffset, FC_Exprloc } |
Static Public Member Functions | |
| static Optional< uint8_t > | getFixedByteSize (dwarf::Form Form, const DWARFUnit *U=nullptr) |
| Get the fixed byte size for a given form. More... | |
| static Optional< uint8_t > | getFixedByteSize (dwarf::Form Form, uint16_t Version, uint8_t AddrSize, llvm::dwarf::DwarfFormat Format) |
| Get the fixed byte size for a given form. More... | |
| static bool | skipValue (dwarf::Form form, DataExtractor debug_info_data, uint32_t *offset_ptr, const DWARFUnit *U) |
Skip a form in debug_info_data at offset specified by offset_ptr. More... | |
| static bool | skipValue (dwarf::Form form, DataExtractor debug_info_data, uint32_t *offset_ptr, uint16_t Version, uint8_t AddrSize, llvm::dwarf::DwarfFormat Format) |
Skip a form in debug_info_data at offset specified by offset_ptr. More... | |
Definition at line 23 of file DWARFFormValue.h.
| Enumerator | |
|---|---|
| FC_Unknown | |
| FC_Address | |
| FC_Block | |
| FC_Constant | |
| FC_String | |
| FC_Flag | |
| FC_Reference | |
| FC_Indirect | |
| FC_SectionOffset | |
| FC_Exprloc | |
Definition at line 25 of file DWARFFormValue.h.
|
inline |
Definition at line 57 of file DWARFFormValue.h.
| void DWARFFormValue::dump | ( | raw_ostream & | OS | ) | const |
Definition at line 438 of file DWARFFormValue.cpp.
References llvm::dwarf::syntax::Address, llvm::format(), llvm::dwarf::syntax::WithColor::get(), and llvm::raw_ostream::write_escaped().
| bool DWARFFormValue::extractValue | ( | const DataExtractor & | Data, |
| uint32_t * | OffsetPtr, | ||
| const DWARFUnit * | U | ||
| ) |
extracts a value in data at offset *offset_ptr.
The passed DWARFUnit is allowed to be nullptr, in which case no relocation processing will be performed and some kind of forms that depend on Unit information are disallowed.
Definition at line 295 of file DWARFFormValue.cpp.
References llvm::StringRef::data(), llvm::StringRef::empty(), llvm::DataExtractor::getCStr(), llvm::DataExtractor::getData(), llvm::DataExtractor::getSLEB128(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU64(), llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), llvm::DataExtractor::getUnsigned(), and llvm::StringRef::substr().
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValue().
| Optional< uint64_t > DWARFFormValue::getAsAddress | ( | ) | const |
Definition at line 595 of file DWARFFormValue.cpp.
References llvm::None.
Definition at line 660 of file DWARFFormValue.cpp.
References llvm::makeArrayRef(), and llvm::None.
Definition at line 574 of file DWARFFormValue.cpp.
References llvm::None, and Offset.
| Optional< uint64_t > DWARFFormValue::getAsCStringOffset | ( | ) | const |
Definition at line 666 of file DWARFFormValue.cpp.
References llvm::None.
| Optional< uint64_t > DWARFFormValue::getAsReference | ( | ) | const |
getAsFoo functions below return the extracted value as Foo if only DWARFFormValue has form class is suitable for representing Foo.
Definition at line 608 of file DWARFFormValue.cpp.
References llvm::None.
| Optional< uint64_t > DWARFFormValue::getAsReferenceUVal | ( | ) | const |
Definition at line 672 of file DWARFFormValue.cpp.
References llvm::None.
| Optional< uint64_t > DWARFFormValue::getAsSectionOffset | ( | ) | const |
Definition at line 629 of file DWARFFormValue.cpp.
References llvm::None.
| Optional< int64_t > DWARFFormValue::getAsSignedConstant | ( | ) | const |
Definition at line 642 of file DWARFFormValue.cpp.
References llvm::None.
| Optional< uint64_t > DWARFFormValue::getAsUnsignedConstant | ( | ) | const |
Definition at line 635 of file DWARFFormValue.cpp.
References llvm::None.
|
static |
Get the fixed byte size for a given form.
If the form always has a fixed valid byte size that doesn't depend on a DWARFUnit, then an Optional with a value will be returned. If the form can vary in size depending on the DWARFUnit (DWARF version, address byte size, or DWARF 32/64) and the DWARFUnit is valid, then an Optional with a valid value is returned. If the form is always encoded using a variable length storage format (ULEB or SLEB numbers or blocks) or the size depends on a DWARFUnit and the DWARFUnit is NULL, then None will be returned.
| Form | The DWARF form to get the fixed byte size for |
| U | The DWARFUnit that can be used to help determine the byte size. |
Form doesn't have a fixed byte size or a DWARFUnit wasn't supplied and was needed to calculate the byte size. Definition at line 255 of file DWARFFormValue.cpp.
References getFixedByteSize().
Referenced by llvm::DWARFAbbreviationDeclaration::extract(), and llvm::DWARFAbbreviationDeclaration::AttributeSpec::getByteSize().
|
static |
Get the fixed byte size for a given form.
If the form has a fixed byte size given a valid DWARF version and address byte size, then an Optional with a valid value is returned. If the form is always encoded using a variable length storage format (ULEB or SLEB numbers or blocks) then None will be returned.
| Form | DWARF form to get the fixed byte size for |
| Version | DWARF version number. |
| AddrSize | size of an address in bytes. |
| Format | enum value from llvm::dwarf::DwarfFormat. |
Form doesn't have a fixed byte size. Definition at line 261 of file DWARFFormValue.cpp.
References getFixedByteSize().
|
inline |
Definition at line 58 of file DWARFFormValue.h.
Definition at line 64 of file DWARFFormValue.h.
| bool DWARFFormValue::isFormClass | ( | DWARFFormValue::FormClass | FC | ) | const |
Definition at line 268 of file DWARFFormValue.cpp.
References DWARF4FormClasses, and llvm::makeArrayRef().
|
inline |
Definition at line 75 of file DWARFFormValue.h.
|
inline |
Definition at line 59 of file DWARFFormValue.h.
References F.
|
inline |
Definition at line 62 of file DWARFFormValue.h.
|
inline |
Definition at line 61 of file DWARFFormValue.h.
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValue().
|
inline |
Definition at line 60 of file DWARFFormValue.h.
| bool DWARFFormValue::skipValue | ( | DataExtractor | debug_info_data, |
| uint32_t * | offset_ptr, | ||
| const DWARFUnit * | U | ||
| ) | const |
Skip a form in debug_info_data at offset specified by offset_ptr.
Skips the bytes for this form in the debug info and updates the offset.
| debug_info_data | the .debug_info data to use to skip the value. |
| offset_ptr | a reference to the offset that will be updated. |
| U | the DWARFUnit to use when skipping the form in case the form size differs according to data in the DWARFUnit. |
Definition at line 419 of file DWARFFormValue.cpp.
Referenced by llvm::DWARFDebugInfoEntry::extractFast(), and llvm::DWARFAbbreviationDeclaration::getAttributeValue().
|
static |
Skip a form in debug_info_data at offset specified by offset_ptr.
Skips the bytes for this form in the debug info and updates the offset.
| form | the DW_FORM enumeration that indicates the form to skip. |
| debug_info_data | the .debug_info data to use to skip the value. |
| offset_ptr | a reference to the offset that will be updated. |
| U | the DWARFUnit to use when skipping the form in case the form size differs according to data in the DWARFUnit. |
Definition at line 424 of file DWARFFormValue.cpp.
References skipFormValue().
|
static |
Skip a form in debug_info_data at offset specified by offset_ptr.
Skips the bytes for this form in the debug info and updates the offset.
| form | the DW_FORM enumeration that indicates the form to skip. |
| debug_info_data | the .debug_info data to use to skip the value. |
| offset_ptr | a reference to the offset that will be updated. |
| Version | DWARF version number. |
| AddrSize | size of an address in bytes. |
| Format | enum value from llvm::dwarf::DwarfFormat. |
Definition at line 429 of file DWARFFormValue.cpp.
References skipFormValue().
1.8.6