LLDB mainline
|
#include <DWARFFormValue.h>
Classes | |
struct | ValueTypeTag |
Public Types | |
enum | { eValueTypeInvalid = 0 , eValueTypeUnsigned , eValueTypeSigned , eValueTypeCStr , eValueTypeBlock } |
typedef struct 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 (lldb_private::Stream &s) const |
bool | ExtractValue (const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr) |
const uint8_t * | BlockData () const |
std::optional< uint8_t > | GetFixedSize () const |
DWARFDIE | Reference () const |
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 lldb_private::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 lldb_private::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 20 of file DWARFFormValue.h.
typedef struct DWARFFormValue::ValueTypeTag DWARFFormValue::ValueType |
anonymous enum |
Enumerator | |
---|---|
eValueTypeInvalid | |
eValueTypeUnsigned | |
eValueTypeSigned | |
eValueTypeCStr | |
eValueTypeBlock |
Definition at line 33 of file DWARFFormValue.h.
|
default |
|
inline |
Definition at line 42 of file DWARFFormValue.h.
Definition at line 43 of file DWARFFormValue.h.
dw_addr_t DWARFFormValue::Address | ( | ) | const |
Definition at line 486 of file DWARFFormValue.cpp.
References DWARFUnit::GetAddrBase(), DWARFUnit::GetAddressByteSize(), SymbolFileDWARF::GetDWARFContext(), lldb_private::DataExtractor::GetMaxU64(), lldb_private::DWARFContext::getOrLoadAddrData(), DWARFUnit::GetSymbolFileDWARF(), m_form, m_unit, m_value, Unsigned(), DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
Referenced by DWARFUnit::AddUnitDIE(), SymbolFileDWARF::CollectCallEdges(), DWARFDebugInfoEntry::GetAttributeHighPC(), DWARFDebugInfoEntry::GetAttributeValueAsAddress(), and DWARFDebugInfoEntry::GetDIENamesAndRanges().
const char * DWARFFormValue::AsCString | ( | ) | const |
Definition at line 461 of file DWARFFormValue.cpp.
References DWARFFormValue::ValueTypeTag::cstr, SymbolFileDWARF::GetDWARFContext(), lldb_private::DWARFContext::getOrLoadLineStrData(), lldb_private::DWARFContext::getOrLoadStrData(), DWARFUnit::GetStringOffsetSectionItem(), DWARFUnit::GetSymbolFileDWARF(), m_form, m_unit, m_value, lldb_private::DataExtractor::PeekCStr(), DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
Referenced by Dump(), DWARFDebugInfoEntry::GetAttributeValueAsString(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), lldb_private::ManualDWARFIndex::IndexUnitImpl(), DWARFASTParserClang::ParseChildEnumerators(), DWARFASTParserClang::ParseChildParameters(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseTemplateDIE(), and SymbolFileDWARF::ParseVariableDIE().
const uint8_t * DWARFFormValue::BlockData | ( | ) | const |
Definition at line 567 of file DWARFFormValue.cpp.
References DWARFFormValue::ValueTypeTag::data, and m_value.
Referenced by SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), DWARFASTParserClang::ParseInheritance(), and SymbolFileDWARF::ParseVariableDIE().
|
inline |
Definition at line 63 of file DWARFFormValue.h.
References m_value, DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
Referenced by SymbolFileDWARF::CollectCallEdges(), DWARFASTParserClang::ParseChildParameters(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParseTemplateDIE(), and SymbolFileDWARF::ParseVariableDIE().
void DWARFFormValue::Clear | ( | ) |
Definition at line 26 of file DWARFFormValue.cpp.
References m_form, m_unit, and m_value.
Referenced by DWARFASTParserClang::ParseTypeModifier().
|
static |
void DWARFFormValue::Dump | ( | lldb_private::Stream & | s | ) | const |
Definition at line 336 of file DWARFFormValue.cpp.
References AsCString(), lldb_private::Stream::AsRawOstream(), DWARFFormValue::ValueTypeTag::data, lldb_private::DumpAddress(), DWARFUnit::GetOffset(), 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 lldb_private::DWARFDataExtractor & | data, |
lldb::offset_t * | offset_ptr | ||
) |
Definition at line 32 of file DWARFFormValue.cpp.
References DWARFFormValue::ValueTypeTag::cstr, DWARFFormValue::ValueTypeTag::data, 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(), DWARFUnit::GetVersion(), m_form, m_unit, m_value, lldb_private::DataExtractor::PeekData(), DWARFFormValue::ValueTypeTag::sval, DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
Referenced by DWARFAttributes::ExtractFormValueAtIndex(), DWARFDebugInfoEntry::GetAttributes(), DWARFDebugInfoEntry::GetAttributeValue(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), and DWARFMappedHash::Header::Read().
|
inline |
Definition at line 47 of file DWARFFormValue.h.
References m_form.
Referenced by DWARFAttributes::Append(), SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), DWARFAttributes::ExtractFormValueAtIndex(), DWARFDebugInfoEntry::GetAttributeHighPC(), DWARFDebugInfoEntry::GetAttributes(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), GetRangesOrReportError(), SymbolFileDWARF::ParseVariableDIE(), and DWARFMappedHash::Header::Read().
|
static |
Definition at line 598 of file DWARFFormValue.cpp.
Referenced by DWARFAbbreviationDeclarationSet::GetUnsupportedForms().
|
inline |
Definition at line 48 of file DWARFFormValue.h.
References m_form.
Referenced by ExtractAttrAndFormValue().
std::optional< uint8_t > DWARFFormValue::GetFixedSize | ( | ) | const |
Definition at line 200 of file DWARFFormValue.cpp.
References GetFixedSize(), m_form, and m_unit.
Referenced by DWARFDebugInfoEntry::Extract(), DWARFDebugInfoEntry::GetAttributes(), and GetFixedSize().
|
static |
Definition at line 191 of file DWARFFormValue.cpp.
References g_form_sizes, DWARFUnit::GetAddressByteSize(), and FormSize::size.
|
inline |
Definition at line 45 of file DWARFFormValue.h.
References m_unit.
Referenced by DWARFAttributes::Append(), and SymbolFileDWARF::ParseVariableDIE().
|
static |
Definition at line 569 of file DWARFFormValue.cpp.
Referenced by SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), and SymbolFileDWARF::ParseVariableDIE().
|
static |
Definition at line 583 of file DWARFFormValue.cpp.
Referenced by SymbolFileDWARF::ParseVariableDIE(), and DWARFMappedHash::Header::Read().
|
inline |
Definition at line 70 of file DWARFFormValue.h.
References m_form.
Referenced by DWARFASTParserClang::ParseEnum(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTypeModifier(), and SymbolFileDWARF::ParseVariableDIE().
DWARFDIE DWARFFormValue::Reference | ( | ) | const |
Definition at line 504 of file DWARFFormValue.cpp.
References DWARFUnit::ContainsDIEOffset(), DIERef::DebugInfo, SymbolFileDWARF::DebugInfo(), DWARFUnit::GetDIE(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), DWARFUnit::GetOffset(), DWARFUnit::GetSymbolFileDWARF(), DWARFTypeUnit::GetTypeOffset(), DWARFDebugInfo::GetTypeUnitForHash(), DWARFDebugInfo::GetUnitContainingDIEOffset(), m_form, m_unit, m_value, DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
Referenced by SymbolFileDWARF::CollectCallEdges(), DWARFAttributes::FormValueAsReferenceAtIndex(), DWARFDebugInfoEntry::GetAttributes(), DWARFDebugInfoEntry::GetAttributeValue(), DWARFDebugInfoEntry::GetAttributeValueAsReference(), DWARFDIE::GetAttributeValueAsReferenceDIE(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), DWARFASTParserClang::GetTypeForDIE(), DWARFASTParserClang::ParseArrayType(), DWARFASTParserClang::ParseChildParameters(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseEnum(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParsePointerToMemberType(), DWARFASTParserClang::ParseSubroutine(), DWARFASTParserClang::ParseTemplateDIE(), DWARFASTParserClang::ParseTypeFromDWARF(), DWARFASTParserClang::ParseTypeModifier(), SymbolFileDWARF::ParseVariableDIE(), and DWARFMappedHash::Header::Read().
uint64_t DWARFFormValue::Reference | ( | dw_offset_t | offset | ) | const |
Definition at line 547 of file DWARFFormValue.cpp.
References DW_INVALID_OFFSET, m_form, m_value, DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
|
inline |
Definition at line 49 of file DWARFFormValue.h.
References m_form.
Referenced by DWARFAttributes::ExtractFormValueAtIndex(), and DWARFDebugInfoEntry::GetAttributeValue().
|
inline |
Definition at line 67 of file DWARFFormValue.h.
References m_value, DWARFFormValue::ValueTypeTag::sval, and DWARFFormValue::ValueTypeTag::value.
Referenced by ExtractAttrAndFormValue().
|
inline |
Definition at line 46 of file DWARFFormValue.h.
References m_unit.
Referenced by DWARFAttributes::ExtractFormValueAtIndex(), and DWARFDebugInfoEntry::GetAttributeValue().
|
inline |
Definition at line 65 of file DWARFFormValue.h.
References m_value, DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
|
inline |
Definition at line 52 of file DWARFFormValue.h.
References m_value.
Referenced by DWARFAttributes::ExtractFormValueAtIndex().
|
inline |
Definition at line 66 of file DWARFFormValue.h.
References m_value, DWARFFormValue::ValueTypeTag::sval, and DWARFFormValue::ValueTypeTag::value.
Referenced by DWARFASTParserClang::ExtractIntFromFormValue(), DWARFASTParserClang::ParseChildEnumerators(), and ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes().
|
static |
Definition at line 209 of file DWARFFormValue.cpp.
References DWARFUnit::GetAddressByteSize(), lldb_private::DataExtractor::GetCStr(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), DWARFUnit::GetVersion(), lldb_private::DataExtractor::Skip_LEB128(), and SkipValue().
bool DWARFFormValue::SkipValue | ( | const lldb_private::DWARFDataExtractor & | debug_info_data, |
lldb::offset_t * | offset_ptr | ||
) | const |
Definition at line 204 of file DWARFFormValue.cpp.
References m_form, m_unit, and SkipValue().
Referenced by DWARFDebugInfoEntry::GetAttributes(), DWARFDebugInfoEntry::GetAttributeValue(), and SkipValue().
|
inline |
Definition at line 64 of file DWARFFormValue.h.
References m_value, DWARFFormValue::ValueTypeTag::uval, and DWARFFormValue::ValueTypeTag::value.
Referenced by Address(), DWARFUnit::AddUnitDIE(), SymbolFileDWARF::CollectCallEdges(), CollectCallSiteParameters(), Dump(), DWARFASTParserClang::ExtractIntFromFormValue(), DWARFDebugInfoEntry::GetAttributeHighPC(), DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned(), DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), GetRangesOrReportError(), lldb_private::ManualDWARFIndex::IndexUnitImpl(), DWARFASTParser::ParseChildArrayInfo(), DWARFASTParserClang::ParseChildEnumerators(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseInheritance(), DWARFASTParserClang::ParseTemplateDIE(), SymbolFileDWARF::ParseVariableDIE(), and DWARFMappedHash::Header::Read().
|
inline |
Definition at line 50 of file DWARFFormValue.h.
References m_value.
Referenced by DWARFAttributes::Append().
|
inline |
Definition at line 51 of file DWARFFormValue.h.
References m_value.
Definition at line 86 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), Clear(), Dump(), ExtractValue(), Form(), FormRef(), GetFixedSize(), IsValid(), Reference(), SetForm(), and SkipValue().
|
protected |
Definition at line 85 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), Clear(), Dump(), ExtractValue(), GetFixedSize(), GetUnit(), Reference(), SetUnit(), and SkipValue().
|
protected |
Definition at line 87 of file DWARFFormValue.h.
Referenced by Address(), AsCString(), BlockData(), Boolean(), Clear(), Dump(), ExtractValue(), Reference(), SetSigned(), SetUnsigned(), SetValue(), Signed(), Unsigned(), Value(), and ValueRef().