Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
bloaty::dwarf::AttrValue Class Reference

#include <attr.h>

Public Member Functions

 AttrValue (const AttrValue &)=default
 
uint16_t form () const
 
absl::string_view GetString (const CU &cu) const
 
uint64_t GetUint (const CU &cu) const
 
bool IsString () const
 
bool IsUint () const
 
AttrValueoperator= (const AttrValue &)=default
 
template<class D >
string_view ReadBlock (string_view *data)
 
template<class D >
string_view ReadIndirectString (const CU &cu, string_view *data)
 
absl::optional< uint64_tToUint (const CU &cu) const
 

Static Public Member Functions

static AttrValue ParseAttr (const CU &cu, uint8_t form, absl::string_view *data)
 

Private Types

enum  Type { Type::kUint, Type::kString, Type::kUnresolvedUint, Type::kUnresolvedString }
 

Private Member Functions

 AttrValue (uint16_t form, absl::string_view val)
 
 AttrValue (uint16_t form, uint64_t val)
 
absl::string_view ResolveDoubleIndirectString (const CU &cu) const
 
uint64_t ResolveIndirectAddress (const CU &cu) const
 
Type type () const
 

Static Private Member Functions

template<class D >
static absl::string_view ReadBlock (absl::string_view *data)
 
template<class D >
static absl::string_view ReadIndirectString (const CU &cu, absl::string_view *data)
 
static absl::string_view ReadVariableBlock (absl::string_view *data)
 
static absl::string_view ResolveIndirectString (const CU &cu, uint64_t ofs)
 
static AttrValue UnresolvedString (uint16_t form, uint64_t val)
 
static AttrValue UnresolvedUint (uint16_t form, uint64_t val)
 

Private Attributes

union {
   absl::string_view   string_
 
   uint64_t   uint_
 
}; 
 
uint16_t form_
 
Type type_
 

Detailed Description

Definition at line 28 of file attr.h.

Member Enumeration Documentation

◆ Type

enum bloaty::dwarf::AttrValue::Type
strongprivate
Enumerator
kUint 
kString 
kUnresolvedUint 
kUnresolvedString 

Definition at line 74 of file attr.h.

Constructor & Destructor Documentation

◆ AttrValue() [1/3]

bloaty::dwarf::AttrValue::AttrValue ( const AttrValue )
default

◆ AttrValue() [2/3]

bloaty::dwarf::AttrValue::AttrValue ( uint16_t  form,
uint64_t  val 
)
inlineexplicitprivate

Definition at line 55 of file attr.h.

◆ AttrValue() [3/3]

bloaty::dwarf::AttrValue::AttrValue ( uint16_t  form,
absl::string_view  val 
)
inlineexplicitprivate

Definition at line 57 of file attr.h.

Member Function Documentation

◆ form()

uint16_t bloaty::dwarf::AttrValue::form ( ) const
inline

Definition at line 35 of file attr.h.

◆ GetString()

string_view bloaty::dwarf::AttrValue::GetString ( const CU cu) const

Definition at line 53 of file attr.cc.

◆ GetUint()

uint64_t bloaty::dwarf::AttrValue::GetUint ( const CU cu) const

Definition at line 44 of file attr.cc.

◆ IsString()

bool bloaty::dwarf::AttrValue::IsString ( ) const
inline

Definition at line 41 of file attr.h.

◆ IsUint()

bool bloaty::dwarf::AttrValue::IsUint ( ) const
inline

Definition at line 37 of file attr.h.

◆ operator=()

AttrValue& bloaty::dwarf::AttrValue::operator= ( const AttrValue )
default

◆ ParseAttr()

AttrValue bloaty::dwarf::AttrValue::ParseAttr ( const CU cu,
uint8_t  form,
absl::string_view data 
)
static

Definition at line 105 of file attr.cc.

◆ ReadBlock() [1/2]

template<class D >
static absl::string_view bloaty::dwarf::AttrValue::ReadBlock ( absl::string_view data)
staticprivate

◆ ReadBlock() [2/2]

template<class D >
string_view bloaty::dwarf::AttrValue::ReadBlock ( string_view data)

Definition at line 63 of file attr.cc.

◆ ReadIndirectString() [1/2]

template<class D >
static absl::string_view bloaty::dwarf::AttrValue::ReadIndirectString ( const CU cu,
absl::string_view data 
)
staticprivate

◆ ReadIndirectString() [2/2]

template<class D >
string_view bloaty::dwarf::AttrValue::ReadIndirectString ( const CU cu,
string_view data 
)

Definition at line 80 of file attr.cc.

◆ ReadVariableBlock()

string_view bloaty::dwarf::AttrValue::ReadVariableBlock ( absl::string_view data)
staticprivate

Definition at line 68 of file attr.cc.

◆ ResolveDoubleIndirectString()

string_view bloaty::dwarf::AttrValue::ResolveDoubleIndirectString ( const CU cu) const
private

Definition at line 85 of file attr.cc.

◆ ResolveIndirectAddress()

uint64_t bloaty::dwarf::AttrValue::ResolveIndirectAddress ( const CU cu) const
private

Definition at line 101 of file attr.cc.

◆ ResolveIndirectString()

string_view bloaty::dwarf::AttrValue::ResolveIndirectString ( const CU cu,
uint64_t  ofs 
)
staticprivate

Definition at line 73 of file attr.cc.

◆ ToUint()

absl::optional< uint64_t > bloaty::dwarf::AttrValue::ToUint ( const CU cu) const

Definition at line 28 of file attr.cc.

◆ type()

Type bloaty::dwarf::AttrValue::type ( ) const
inlineprivate

Definition at line 81 of file attr.h.

◆ UnresolvedString()

static AttrValue bloaty::dwarf::AttrValue::UnresolvedString ( uint16_t  form,
uint64_t  val 
)
inlinestaticprivate

Definition at line 89 of file attr.h.

◆ UnresolvedUint()

static AttrValue bloaty::dwarf::AttrValue::UnresolvedUint ( uint16_t  form,
uint64_t  val 
)
inlinestaticprivate

Definition at line 83 of file attr.h.

Member Data Documentation

◆ @101

union { ... }

◆ form_

uint16_t bloaty::dwarf::AttrValue::form_
private

Definition at line 100 of file attr.h.

◆ string_

absl::string_view bloaty::dwarf::AttrValue::string_

Definition at line 97 of file attr.h.

◆ type_

Type bloaty::dwarf::AttrValue::type_
private

Definition at line 101 of file attr.h.

◆ uint_

uint64_t bloaty::dwarf::AttrValue::uint_

Definition at line 96 of file attr.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:02:58