LLDB mainline
lldb_private::RegisterTypeUnion Class Reference

A GDB target-description union type. More...

#include <RegisterType.h>

Inheritance diagram for lldb_private::RegisterTypeUnion:
[legend]

Classes

class  Field

Public Member Functions

 RegisterTypeUnion (std::string id, std::vector< Field > fields)
const std::vector< Field > & GetFields () const
std::optional< uint64_t > GetByteSize () const override
 Return this type's fixed size in bytes, if it has one.
bool IsByteSizeCompatible (uint64_t byte_size) const
void DumpToLog (Log *log) const
void ToXMLElement (Stream &strm, const RegisterType *user=nullptr) const override
 Output the register type as an XML element.
Public Member Functions inherited from lldb_private::RegisterType
RegisterTypeKind getKind () const
 RegisterType (RegisterTypeKind kind, std::string id)
 RegisterType (const RegisterType &)=delete
RegisterTypeoperator= (const RegisterType &)=delete
 RegisterType (RegisterType &&)=delete
RegisterTypeoperator= (RegisterType &&)=delete
virtual void ToXML (Stream &strm, std::unordered_set< std::string > &previously_emitted, const RegisterType *user=nullptr) const
 Output XML that describes this type, to be inserted into a target XML file.
virtual ~RegisterType ()=default
const std::string & GetID () const
uint64_t GetUID () const
 Return an identifier unique among all RegisterType instances constructed during the lifetime of the LLDB host process.
void SetDependencies (std::vector< const RegisterType * > dependencies)

Static Public Member Functions

static bool classof (const RegisterType *type)
Static Public Member Functions inherited from lldb_private::RegisterType
static void PrintXMLAttributeValue (Stream &strm, llvm::StringRef value)
 Print a string escaped for use as an XML attribute value.

Private Attributes

const std::vector< Fieldm_fields

Additional Inherited Members

Public Types inherited from lldb_private::RegisterType
enum  RegisterTypeKind {
  eRegisterTypeKindFlags , eRegisterTypeKindEnum , eRegisterTypeKindBuiltin , eRegisterTypeKindVector ,
  eRegisterTypeKindUnion
}

Detailed Description

A GDB target-description union type.

Each field is an alternative view of the same register data. Referenced field types must outlive the union.

Definition at line 138 of file RegisterType.h.

Constructor & Destructor Documentation

◆ RegisterTypeUnion()

RegisterTypeUnion::RegisterTypeUnion ( std::string id,
std::vector< Field > fields )

Member Function Documentation

◆ classof()

bool lldb_private::RegisterTypeUnion::classof ( const RegisterType * type)
inlinestatic

◆ DumpToLog()

void RegisterTypeUnion::DumpToLog ( Log * log) const

Definition at line 165 of file RegisterType.cpp.

References lldb_private::RegisterType::GetID(), LLDB_LOG, and m_fields.

◆ GetByteSize()

std::optional< uint64_t > RegisterTypeUnion::GetByteSize ( ) const
overridevirtual

Return this type's fixed size in bytes, if it has one.

No byte size means it depends on the target.

Reimplemented from lldb_private::RegisterType.

Definition at line 131 of file RegisterType.cpp.

References m_fields.

Referenced by IsByteSizeCompatible().

◆ GetFields()

const std::vector< Field > & lldb_private::RegisterTypeUnion::GetFields ( ) const
inline

Definition at line 154 of file RegisterType.h.

References m_fields.

◆ IsByteSizeCompatible()

bool RegisterTypeUnion::IsByteSizeCompatible ( uint64_t byte_size) const

Definition at line 142 of file RegisterType.cpp.

References GetByteSize(), and m_fields.

◆ ToXMLElement()

void RegisterTypeUnion::ToXMLElement ( Stream & strm,
const RegisterType * user = nullptr ) const
overridevirtual

Output the register type as an XML element.

That is, "<foo ...>" until the closing </foo>, including any child types in between. For example the flags in a register flag set.

Implements lldb_private::RegisterType.

Definition at line 174 of file RegisterType.cpp.

References lldb_private::RegisterType::GetID(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_fields, lldb_private::RegisterType::PrintXMLAttributeValue(), and lldb_private::RegisterType::RegisterType().

Member Data Documentation

◆ m_fields

const std::vector<Field> lldb_private::RegisterTypeUnion::m_fields
private

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