LLDB mainline
Classes | Public Member Functions | Private Attributes | List of all members
lldb_private::RegisterFlags Class Reference

#include <RegisterFlags.h>

Classes

class  Field
 

Public Member Functions

 RegisterFlags (std::string id, unsigned size, const std::vector< Field > &fields)
 This assumes that:
 
void SetFields (const std::vector< Field > &fields)
 Replace all the fields with the new set of fields.
 
template<typename T >
ReverseFieldOrder (T value) const
 
const std::vector< Field > & GetFields () const
 
const std::string & GetID () const
 
unsigned GetSize () const
 
void log (Log *log) const
 
std::string AsTable (uint32_t max_width) const
 Produce a text table showing the layout of all the fields.
 
void ToXML (StreamString &strm) const
 

Private Attributes

const std::string m_id
 
const unsigned m_size
 Size in bytes.
 
std::vector< Fieldm_fields
 

Detailed Description

Definition at line 21 of file RegisterFlags.h.

Constructor & Destructor Documentation

◆ RegisterFlags()

RegisterFlags::RegisterFlags ( std::string  id,
unsigned  size,
const std::vector< Field > &  fields 
)

This assumes that:

  • There is at least one field.
  • The fields are sorted in descending order. Gaps are allowed, they will be filled with anonymous padding fields.

Definition at line 99 of file RegisterFlags.cpp.

References SetFields().

Member Function Documentation

◆ AsTable()

std::string RegisterFlags::AsTable ( uint32_t  max_width) const

Produce a text table showing the layout of all the fields.

Unnamed/padding fields will be included, with only their positions shown. max_width will be the width in characters of the terminal you are going to print the table to. If the table would exceed this width, it will be split into many tables as needed.

Definition at line 138 of file RegisterFlags.cpp.

References EmitTable(), FormatCell(), lldb_private::StreamString::GetString(), m_fields, and lldb_private::Stream::Printf().

◆ GetFields()

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

◆ GetID()

const std::string & lldb_private::RegisterFlags::GetID ( ) const
inline

◆ GetSize()

unsigned lldb_private::RegisterFlags::GetSize ( ) const
inline

Definition at line 111 of file RegisterFlags.h.

References m_size.

Referenced by lldb_private::RegisterTypeBuilderClang::GetRegisterType(), and ToXML().

◆ log()

void RegisterFlags::log ( Log log) const

Definition at line 105 of file RegisterFlags.cpp.

References LLDB_LOG, log(), m_fields, m_id, and m_size.

Referenced by lldb_private::RegisterFlags::Field::log(), and log().

◆ ReverseFieldOrder()

template<typename T >
T lldb_private::RegisterFlags::ReverseFieldOrder ( value) const
inline

Definition at line 98 of file RegisterFlags.h.

References GetFields().

Referenced by dump_type_value().

◆ SetFields()

void RegisterFlags::SetFields ( const std::vector< Field > &  fields)

Replace all the fields with the new set of fields.

All the assumptions and checks apply as when you use the constructor. Intended to only be used when runtime field detection is needed.

Definition at line 56 of file RegisterFlags.cpp.

References m_fields, and m_size.

Referenced by RegisterFlags().

◆ ToXML()

void RegisterFlags::ToXML ( StreamString strm) const

Member Data Documentation

◆ m_fields

std::vector<Field> lldb_private::RegisterFlags::m_fields
private

Definition at line 128 of file RegisterFlags.h.

Referenced by AsTable(), GetFields(), log(), SetFields(), and ToXML().

◆ m_id

const std::string lldb_private::RegisterFlags::m_id
private

Definition at line 125 of file RegisterFlags.h.

Referenced by GetID(), and log().

◆ m_size

const unsigned lldb_private::RegisterFlags::m_size
private

Size in bytes.

Definition at line 127 of file RegisterFlags.h.

Referenced by GetSize(), log(), and SetFields().


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