LLDB mainline
|
#include <DWARFFormValue.h>
Classes | |
struct | ValueTypeTag |
Public Types | |
enum | { eValueTypeInvalid = 0 , eValueTypeUnsigned , eValueTypeSigned , eValueTypeCStr , eValueTypeBlock } |
typedef struct lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag | 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 () |
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 struct lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag lldb_private::plugin::dwarf::DWARFFormValue::ValueType |
anonymous enum |
Enumerator | |
---|---|
eValueTypeInvalid | |
eValueTypeUnsigned | |
eValueTypeSigned | |
eValueTypeCStr | |
eValueTypeBlock |
Definition at line 35 of file DWARFFormValue.h.
|
default |
|
inline |
Definition at line 44 of file DWARFFormValue.h.
|
inline |
Definition at line 45 of file DWARFFormValue.h.
dw_addr_t DWARFFormValue::Address | ( | ) | const |
Definition at line 485 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, Unsigned(), lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::value.
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 460 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::cstr, 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, lldb_private::DataExtractor::PeekCStr(), lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::value.
Referenced by Dump(), 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 572 of file DWARFFormValue.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::data, and 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 70 of file DWARFFormValue.h.
References m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::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 335 of file DWARFFormValue.cpp.
References AsCString(), lldb_private::Stream::AsRawOstream(), lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::data, 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::DWARFFormValue::ValueTypeTag::cstr, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::data, 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, lldb_private::DataExtractor::PeekData(), lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::sval, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::value.
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 49 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(), GetRangesOrReportError(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
static |
Definition at line 603 of file DWARFFormValue.cpp.
Referenced by GetUnsupportedForms().
|
inline |
Definition at line 50 of file DWARFFormValue.h.
References m_form.
Referenced by ExtractAttrAndFormValue().
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 47 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 574 of file DWARFFormValue.cpp.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), GetExprListFromAtConstValue(), and GetExprListFromAtLocation().
|
static |
Definition at line 588 of file DWARFFormValue.cpp.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
inline |
Definition at line 77 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 547 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(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
uint64_t DWARFFormValue::Reference | ( | dw_offset_t | offset | ) | const |
Definition at line 552 of file DWARFFormValue.cpp.
References DW_INVALID_OFFSET, m_form, m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::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 504 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, m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::value.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName(), and Reference().
|
inline |
Definition at line 51 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 74 of file DWARFFormValue.h.
References m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::sval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::value.
Referenced by ExtractAttrAndFormValue().
|
inline |
Definition at line 48 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 72 of file DWARFFormValue.h.
References m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::value.
|
inline |
Definition at line 54 of file DWARFFormValue.h.
References m_value.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex().
|
inline |
Definition at line 73 of file DWARFFormValue.h.
References m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::sval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::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 71 of file DWARFFormValue.h.
References m_value, lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::uval, and lldb_private::plugin::dwarf::DWARFFormValue::ValueTypeTag::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(), GetRangesOrReportError(), 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 52 of file DWARFFormValue.h.
References m_value.
Referenced by lldb_private::plugin::dwarf::DWARFAttributes::Append().
|
inline |
Definition at line 53 of file DWARFFormValue.h.
References m_value.
Definition at line 93 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), Clear(), Dump(), ExtractValue(), Form(), FormRef(), GetFixedSize(), IsValid(), Reference(), ReferencedUnitAndOffset(), SetForm(), and SkipValue().
|
protected |
Definition at line 92 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), Clear(), Dump(), ExtractValue(), GetFixedSize(), GetUnit(), ReferencedUnitAndOffset(), SetUnit(), and SkipValue().
|
protected |
Definition at line 94 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), BlockData(), Boolean(), Clear(), Dump(), ExtractValue(), Reference(), ReferencedUnitAndOffset(), SetSigned(), SetUnsigned(), SetValue(), Signed(), Unsigned(), Value(), and ValueRef().