LLDB mainline
|
#include <DWARFFormValue.h>
Public Types | |
enum | { eValueTypeInvalid = 0 , eValueTypeUnsigned , eValueTypeSigned , eValueTypeCStr , eValueTypeBlock } |
typedef llvm::DWARFFormValue::ValueType | ValueType |
Public Member Functions | |
DWARFFormValue ()=default | |
DWARFFormValue (const DWARFUnit *unit) | |
DWARFFormValue (const DWARFUnit *unit, dw_form_t form) | |
const DWARFUnit * | GetUnit () const |
void | SetUnit (const DWARFUnit *unit) |
dw_form_t | Form () const |
dw_form_t & | FormRef () |
void | SetForm (dw_form_t form) |
const ValueType & | Value () const |
ValueType & | ValueRef () |
void | SetValue (const ValueType &val) |
void | Dump (Stream &s) const |
bool | ExtractValue (const DWARFDataExtractor &data, lldb::offset_t *offset_ptr) |
const uint8_t * | BlockData () const |
std::optional< uint8_t > | GetFixedSize () const |
DWARFDIE | Reference () const |
std::pair< DWARFUnit *, uint64_t > | ReferencedUnitAndOffset () const |
If this is a reference to another DIE, return the corresponding DWARFUnit and DIE offset such that Unit->GetDIE(offset) produces the desired DIE. | |
uint64_t | Reference (dw_offset_t offset) const |
bool | Boolean () const |
uint64_t | Unsigned () const |
void | SetUnsigned (uint64_t uval) |
int64_t | Signed () const |
void | SetSigned (int64_t sval) |
const char * | AsCString () const |
dw_addr_t | Address () const |
bool | IsValid () const |
bool | SkipValue (const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr) const |
void | Clear () |
std::optional< uint64_t > | getAsUnsignedConstant () const |
std::optional< int64_t > | getAsSignedConstant () const |
const char * | getAsCString () const |
Static Public Member Functions | |
static std::optional< uint8_t > | GetFixedSize (dw_form_t form, const DWARFUnit *u) |
static bool | SkipValue (const dw_form_t form, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, const DWARFUnit *unit) |
static bool | IsBlockForm (const dw_form_t form) |
static bool | IsDataForm (const dw_form_t form) |
static int | Compare (const DWARFFormValue &a, const DWARFFormValue &b) |
static bool | FormIsSupported (dw_form_t form) |
Protected Attributes | |
const DWARFUnit * | m_unit = nullptr |
dw_form_t | m_form = dw_form_t(0) |
ValueType | m_value |
Definition at line 22 of file DWARFFormValue.h.
typedef llvm::DWARFFormValue::ValueType lldb_private::plugin::dwarf::DWARFFormValue::ValueType |
Definition at line 24 of file DWARFFormValue.h.
anonymous enum |
Enumerator | |
---|---|
eValueTypeInvalid | |
eValueTypeUnsigned | |
eValueTypeSigned | |
eValueTypeCStr | |
eValueTypeBlock |
Definition at line 25 of file DWARFFormValue.h.
|
default |
|
inline |
Definition at line 34 of file DWARFFormValue.h.
|
inline |
Definition at line 35 of file DWARFFormValue.h.
dw_addr_t DWARFFormValue::Address | ( | ) | const |
Definition at line 490 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetAddrBase(), lldb_private::plugin::dwarf::DWARFUnit::GetAddressByteSize(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDWARFContext(), lldb_private::DataExtractor::GetMaxU64(), lldb_private::plugin::dwarf::DWARFContext::getOrLoadAddrData(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), m_form, m_unit, m_value, and Unsigned().
Referenced by lldb_private::plugin::dwarf::DWARFUnit::AddUnitDIE(), lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeHighPC(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValueAsAddress(), and lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges().
const char * DWARFFormValue::AsCString | ( | ) | const |
Definition at line 465 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::SymbolFileDWARF::GetDWARFContext(), lldb_private::plugin::dwarf::DWARFContext::getOrLoadLineStrData(), lldb_private::plugin::dwarf::DWARFContext::getOrLoadStrData(), lldb_private::plugin::dwarf::DWARFUnit::GetStringOffsetSectionItem(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), m_form, m_unit, m_value, and lldb_private::DataExtractor::PeekCStr().
Referenced by Dump(), getAsCString(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValueAsString(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), GetExprListFromAtConstValue(), lldb_private::plugin::dwarf::ManualDWARFIndex::IndexUnitImpl(), DWARFASTParserClang::MemberAttributes::MemberAttributes(), DWARFASTParserClang::ParseChildEnumerators(), DWARFASTParserClang::ParseChildParameters(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseTemplateDIE(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
const uint8_t * DWARFFormValue::BlockData | ( | ) | const |
Definition at line 602 of file DWARFFormValue.cpp.
References m_value.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), ExtractDataMemberLocation(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), GetExprListFromAtConstValue(), and GetExprListFromAtLocation().
|
inline |
Definition at line 60 of file DWARFFormValue.h.
References m_value.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), DWARFASTParserClang::MemberAttributes::MemberAttributes(), DWARFASTParserClang::ParseChildParameters(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParseTemplateDIE(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
void DWARFFormValue::Clear | ( | ) |
Definition at line 25 of file DWARFFormValue.cpp.
References m_form, m_unit, and m_value.
Referenced by DWARFASTParserClang::ParseTypeModifier().
|
static |
void DWARFFormValue::Dump | ( | Stream & | s | ) | const |
Definition at line 340 of file DWARFFormValue.cpp.
References AsCString(), lldb_private::Stream::AsRawOstream(), lldb_private::DumpAddress(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), lldb_private::plugin::dwarf::DWARFUnit::GetVersion(), m_form, m_unit, m_value, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::Stream::PutHex16(), lldb_private::Stream::PutHex32(), lldb_private::Stream::PutHex64(), lldb_private::Stream::PutHex8(), lldb_private::Stream::PutSLEB128(), lldb_private::Stream::PutULEB128(), lldb_private::Stream::QuotedCString(), and Unsigned().
bool DWARFFormValue::ExtractValue | ( | const DWARFDataExtractor & | data, |
lldb::offset_t * | offset_ptr | ||
) |
Definition at line 31 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetAddressByteSize(), lldb_private::DataExtractor::GetCStr(), lldb_private::DataExtractor::GetMaxU64(), lldb_private::DataExtractor::GetSLEB128(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), lldb_private::plugin::dwarf::DWARFUnit::GetVersion(), m_form, m_unit, m_value, and lldb_private::DataExtractor::PeekData().
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributes(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges().
|
inline |
Definition at line 39 of file DWARFFormValue.h.
References m_form.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::Append(), lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeHighPC(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributes(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), GetExprListFromAtConstValue(), GetExprListFromAtLocation(), GetRanges(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
static |
Definition at line 634 of file DWARFFormValue.cpp.
Referenced by GetUnsupportedForms().
|
inline |
Definition at line 40 of file DWARFFormValue.h.
References m_form.
Referenced by ExtractAttrAndFormValue().
|
inline |
Definition at line 83 of file DWARFFormValue.h.
References AsCString().
std::optional< int64_t > DWARFFormValue::getAsSignedConstant | ( | ) | const |
Definition at line 583 of file DWARFFormValue.cpp.
References IsDataForm(), m_form, and m_value.
std::optional< uint64_t > DWARFFormValue::getAsUnsignedConstant | ( | ) | const |
Definition at line 577 of file DWARFFormValue.cpp.
References IsDataForm(), m_form, and m_value.
std::optional< uint8_t > DWARFFormValue::GetFixedSize | ( | ) | const |
Definition at line 199 of file DWARFFormValue.cpp.
References GetFixedSize(), m_form, and m_unit.
Referenced by lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributes(), and GetFixedSize().
|
static |
Definition at line 190 of file DWARFFormValue.cpp.
References g_form_sizes, lldb_private::plugin::dwarf::DWARFUnit::GetAddressByteSize(), and FormSize::size.
|
inline |
Definition at line 37 of file DWARFFormValue.h.
References m_unit.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::Append(), GetExprListFromAtLocation(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
static |
Definition at line 604 of file DWARFFormValue.cpp.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), GetExprListFromAtConstValue(), and GetExprListFromAtLocation().
|
static |
Definition at line 619 of file DWARFFormValue.cpp.
Referenced by getAsSignedConstant(), getAsUnsignedConstant(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
inline |
Definition at line 67 of file DWARFFormValue.h.
References m_form.
Referenced by DWARFASTParserClang::ParseCXXMethod(), DWARFASTParserClang::ParseEnum(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTypeModifier(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
DWARFDIE DWARFFormValue::Reference | ( | ) | const |
Definition at line 552 of file DWARFFormValue.cpp.
References ReferencedUnitAndOffset().
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), DWARFASTParserClang::CreateStaticMemberVariable(), lldb_private::plugin::dwarf::DWARFAttributes::FormValueAsReferenceAtIndex(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributes(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValue(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValueAsReference(), lldb_private::plugin::dwarf::DWARFDIE::GetAttributeValueAsReferenceDIE(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), lldb_private::plugin::dwarf::DWARFASTParser::GetTypeForDIE(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseChildParameters(), DWARFASTParserClang::ParseCXXMethod(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseEnum(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParseObjCProperty(), DWARFASTParserClang::ParsePointerToMemberType(), DWARFASTParserClang::ParseSingleMember(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTemplateDIE(), DWARFASTParserClang::ParseTypeFromDWARF(), DWARFASTParserClang::ParseTypeModifier(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE(), and lldb_private::plugin::dwarf::DWARFDIE::resolveReferencedType().
uint64_t DWARFFormValue::Reference | ( | dw_offset_t | offset | ) | const |
Definition at line 557 of file DWARFFormValue.cpp.
References DW_INVALID_OFFSET, m_form, and m_value.
std::pair< DWARFUnit *, uint64_t > DWARFFormValue::ReferencedUnitAndOffset | ( | ) | const |
If this is a reference to another DIE, return the corresponding DWARFUnit and DIE offset such that Unit->GetDIE(offset) produces the desired DIE.
Otherwise, a nullptr and unspecified offset are returned.
Definition at line 509 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::ContainsDIEOffset(), lldb_private::plugin::dwarf::DIERef::DebugInfo, lldb_private::plugin::dwarf::SymbolFileDWARF::DebugInfo(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), lldb_private::plugin::dwarf::DWARFTypeUnit::GetTypeOffset(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetTypeUnitForHash(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnitContainingDIEOffset(), m_form, m_unit, and m_value.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName(), and Reference().
|
inline |
Definition at line 41 of file DWARFFormValue.h.
References m_form.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), and lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValue().
|
inline |
Definition at line 64 of file DWARFFormValue.h.
References m_value.
Referenced by ExtractAttrAndFormValue().
|
inline |
Definition at line 38 of file DWARFFormValue.h.
References m_unit.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), and lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValue().
|
inline |
Definition at line 62 of file DWARFFormValue.h.
References m_value.
|
inline |
Definition at line 44 of file DWARFFormValue.h.
References m_value.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex().
|
inline |
Definition at line 63 of file DWARFFormValue.h.
References m_value.
Referenced by DWARFASTParserClang::ExtractIntFromFormValue(), DWARFASTParserClang::MemberAttributes::MemberAttributes(), DWARFASTParserClang::ParseChildEnumerators(), and ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes().
|
static |
Definition at line 208 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetAddressByteSize(), lldb_private::DataExtractor::GetCStr(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), lldb_private::plugin::dwarf::DWARFUnit::GetVersion(), lldb_private::DataExtractor::Skip_LEB128(), and SkipValue().
bool DWARFFormValue::SkipValue | ( | const DWARFDataExtractor & | debug_info_data, |
lldb::offset_t * | offset_ptr | ||
) | const |
Definition at line 203 of file DWARFFormValue.cpp.
References m_form, m_unit, and SkipValue().
Referenced by lldb_private::plugin::dwarf::DWARFDebugInfoEntry::Extract(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributes(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValue(), and SkipValue().
|
inline |
Definition at line 61 of file DWARFFormValue.h.
References m_value.
Referenced by Address(), lldb_private::plugin::dwarf::DWARFUnit::AddUnitDIE(), lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), Dump(), ExtractDataMemberLocation(), DWARFASTParserClang::ExtractIntFromFormValue(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeHighPC(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), GetExprListFromAtConstValue(), GetExprListFromAtLocation(), GetRanges(), lldb_private::plugin::dwarf::ManualDWARFIndex::IndexUnitImpl(), DWARFASTParserClang::MemberAttributes::MemberAttributes(), lldb_private::plugin::dwarf::DWARFASTParser::ParseChildArrayInfo(), DWARFASTParserClang::ParseChildEnumerators(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParseTemplateDIE(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
inline |
Definition at line 42 of file DWARFFormValue.h.
References m_value.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::Append().
|
inline |
Definition at line 43 of file DWARFFormValue.h.
References m_value.
Definition at line 89 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), Clear(), Dump(), ExtractValue(), Form(), FormRef(), getAsSignedConstant(), getAsUnsignedConstant(), GetFixedSize(), IsValid(), Reference(), ReferencedUnitAndOffset(), SetForm(), and SkipValue().
|
protected |
Definition at line 88 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), Clear(), Dump(), ExtractValue(), GetFixedSize(), GetUnit(), ReferencedUnitAndOffset(), SetUnit(), and SkipValue().
|
protected |
Definition at line 90 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), BlockData(), Boolean(), Clear(), Dump(), ExtractValue(), getAsSignedConstant(), getAsUnsignedConstant(), Reference(), ReferencedUnitAndOffset(), SetSigned(), SetUnsigned(), SetValue(), Signed(), Unsigned(), Value(), and ValueRef().