LLDB mainline
|
#include <RegisterFlags.h>
Public Member Functions | |
Field (std::string name, unsigned start, unsigned end) | |
Where start is the least significant bit and end is the most significant bit. | |
Field (std::string name, unsigned start, unsigned end, const FieldEnum *enum_type) | |
Construct a field that also has some known enum values. | |
Field (std::string name, unsigned bit_position) | |
Construct a field that occupies a single bit. | |
unsigned | GetSizeInBits () const |
Get size of the field in bits. Will always be at least 1. | |
uint64_t | GetMask () const |
A mask that covers all bits of the field. | |
uint64_t | GetMaxValue () const |
The maximum unsigned value that could be contained in this field. | |
uint64_t | GetValue (uint64_t register_value) const |
Extract value of the field from a whole register value. | |
const std::string & | GetName () const |
unsigned | GetStart () const |
unsigned | GetEnd () const |
const FieldEnum * | GetEnum () const |
bool | Overlaps (const Field &other) const |
void | DumpToLog (Log *log) const |
unsigned | PaddingDistance (const Field &other) const |
Return the number of bits between this field and the other, that are not covered by either field. | |
void | ToXML (Stream &strm) const |
Output XML that describes this field, to be inserted into a target XML file. | |
bool | operator< (const Field &rhs) const |
bool | operator== (const Field &rhs) const |
Static Public Member Functions | |
static unsigned | GetSizeInBits (unsigned start, unsigned end) |
Identical to GetSizeInBits, but for the GDB client to use. | |
static uint64_t | GetMaxValue (unsigned start, unsigned end) |
Identical to GetMaxValue but for the GDB client to use. | |
Private Attributes | |
std::string | m_name |
unsigned | m_start |
Start/end bit positions. | |
unsigned | m_end |
const FieldEnum * | m_enum_type |
Definition at line 61 of file RegisterFlags.h.
RegisterFlags::Field::Field | ( | std::string | name, |
unsigned | start, | ||
unsigned | end | ||
) |
Where start is the least significant bit and end is the most significant bit.
The start bit must be <= the end bit.
Definition at line 21 of file RegisterFlags.cpp.
RegisterFlags::Field::Field | ( | std::string | name, |
unsigned | start, | ||
unsigned | end, | ||
const FieldEnum * | enum_type | ||
) |
Construct a field that also has some known enum values.
Definition at line 31 of file RegisterFlags.cpp.
References lldb_private::FieldEnum::GetEnumerators(), GetMaxValue(), m_enum_type, and UNUSED_IF_ASSERT_DISABLED.
RegisterFlags::Field::Field | ( | std::string | name, |
unsigned | bit_position | ||
) |
Construct a field that occupies a single bit.
Definition at line 27 of file RegisterFlags.cpp.
void RegisterFlags::Field::DumpToLog | ( | Log * | log | ) | const |
Definition at line 50 of file RegisterFlags.cpp.
References LLDB_LOG.
|
inline |
|
inline |
Definition at line 97 of file RegisterFlags.h.
References m_enum_type.
uint64_t RegisterFlags::Field::GetMask | ( | ) | const |
A mask that covers all bits of the field.
Definition at line 106 of file RegisterFlags.cpp.
Referenced by GetValue().
uint64_t RegisterFlags::Field::GetMaxValue | ( | ) | const |
The maximum unsigned value that could be contained in this field.
Definition at line 102 of file RegisterFlags.cpp.
Referenced by Field().
|
static |
Identical to GetMaxValue but for the GDB client to use.
Definition at line 89 of file RegisterFlags.cpp.
References lldb_private::bits().
|
inline |
Definition at line 94 of file RegisterFlags.h.
References m_name.
unsigned RegisterFlags::Field::GetSizeInBits | ( | ) | const |
Get size of the field in bits. Will always be at least 1.
Definition at line 85 of file RegisterFlags.cpp.
Referenced by PaddingDistance().
|
static |
Identical to GetSizeInBits, but for the GDB client to use.
Definition at line 81 of file RegisterFlags.cpp.
|
inline |
Definition at line 95 of file RegisterFlags.h.
References m_start.
Referenced by operator<(), Overlaps(), and PaddingDistance().
|
inline |
Extract value of the field from a whole register value.
Definition at line 90 of file RegisterFlags.h.
|
inline |
Definition at line 110 of file RegisterFlags.h.
References GetStart().
|
inline |
Definition at line 114 of file RegisterFlags.h.
bool RegisterFlags::Field::Overlaps | ( | const Field & | other | ) | const |
Definition at line 55 of file RegisterFlags.cpp.
References GetEnd(), and GetStart().
unsigned RegisterFlags::Field::PaddingDistance | ( | const Field & | other | ) | const |
Return the number of bits between this field and the other, that are not covered by either field.
Definition at line 61 of file RegisterFlags.cpp.
References GetSizeInBits(), GetStart(), and Overlaps().
void RegisterFlags::Field::ToXML | ( | Stream & | strm | ) | const |
Output XML that describes this field, to be inserted into a target XML file.
Reserved characters in field names like "<" are replaced with their XML safe equivalents like ">".
Definition at line 402 of file RegisterFlags.cpp.
References GetName(), lldb_private::Stream::Indent(), and lldb_private::Stream::Printf().
|
private |
Definition at line 127 of file RegisterFlags.h.
Referenced by Field(), GetEnd(), and operator==().
|
private |
Definition at line 129 of file RegisterFlags.h.
|
private |
Definition at line 120 of file RegisterFlags.h.
Referenced by GetName(), and operator==().
|
private |
Start/end bit positions.
Where start N, end N means a single bit field at position N. We expect that start <= end. Bit positions begin at 0. Start is the LSB, end is the MSB.
Definition at line 126 of file RegisterFlags.h.
Referenced by Field(), GetStart(), GetValue(), and operator==().