|
LLDB mainline
|
#include <RegisterTypeFlags.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 RegisterTypeEnum *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 RegisterTypeEnum * | 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 | ToXMLElement (Stream &strm) const |
| 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 RegisterTypeEnum * | m_enum_type |
Definition at line 64 of file RegisterTypeFlags.h.
| RegisterTypeFlags::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 24 of file RegisterTypeFlags.cpp.
References m_end, m_enum_type, m_name, and m_start.
Referenced by operator<(), operator==(), Overlaps(), and PaddingDistance().
| RegisterTypeFlags::Field::Field | ( | std::string | name, |
| unsigned | start, | ||
| unsigned | end, | ||
| const RegisterTypeEnum * | enum_type ) |
Construct a field that also has some known enum values.
Definition at line 34 of file RegisterTypeFlags.cpp.
References GetMaxValue(), m_end, m_enum_type, m_name, m_start, and UNUSED_IF_ASSERT_DISABLED.
| RegisterTypeFlags::Field::Field | ( | std::string | name, |
| unsigned | bit_position ) |
Construct a field that occupies a single bit.
Definition at line 30 of file RegisterTypeFlags.cpp.
References m_end, m_enum_type, m_name, and m_start.
| void RegisterTypeFlags::Field::DumpToLog | ( | Log * | log | ) | const |
|
inline |
Definition at line 99 of file RegisterTypeFlags.h.
References m_end.
Referenced by Overlaps(), and ToXMLElement().
|
inline |
Definition at line 100 of file RegisterTypeFlags.h.
References m_enum_type.
Referenced by ToXMLElement().
| uint64_t RegisterTypeFlags::Field::GetMask | ( | ) | const |
A mask that covers all bits of the field.
Definition at line 109 of file RegisterTypeFlags.cpp.
Referenced by GetValue().
| uint64_t RegisterTypeFlags::Field::GetMaxValue | ( | ) | const |
The maximum unsigned value that could be contained in this field.
Definition at line 105 of file RegisterTypeFlags.cpp.
Referenced by Field().
|
static |
Identical to GetMaxValue but for the GDB client to use.
Definition at line 92 of file RegisterTypeFlags.cpp.
References lldb_private::bits(), and GetSizeInBits().
|
inline |
Definition at line 97 of file RegisterTypeFlags.h.
References m_name.
| unsigned RegisterTypeFlags::Field::GetSizeInBits | ( | ) | const |
Get size of the field in bits. Will always be at least 1.
Definition at line 88 of file RegisterTypeFlags.cpp.
References GetSizeInBits(), m_end, and m_start.
Referenced by GetMaxValue(), GetSizeInBits(), and PaddingDistance().
|
static |
Identical to GetSizeInBits, but for the GDB client to use.
Definition at line 84 of file RegisterTypeFlags.cpp.
|
inline |
Definition at line 98 of file RegisterTypeFlags.h.
References m_start.
Referenced by operator<(), Overlaps(), PaddingDistance(), and ToXMLElement().
|
inline |
Extract value of the field from a whole register value.
Definition at line 93 of file RegisterTypeFlags.h.
Definition at line 110 of file RegisterTypeFlags.h.
References Field(), and GetStart().
Definition at line 58 of file RegisterTypeFlags.cpp.
References Field(), GetEnd(), and GetStart().
| unsigned RegisterTypeFlags::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 64 of file RegisterTypeFlags.cpp.
References Field(), GetSizeInBits(), GetStart(), and Overlaps().
| void RegisterTypeFlags::Field::ToXMLElement | ( | Stream & | strm | ) | const |
Definition at line 409 of file RegisterTypeFlags.cpp.
References GetEnd(), GetEnum(), GetName(), GetStart(), lldb_private::Stream::Indent(), and lldb_private::Stream::Printf().
|
private |
Definition at line 127 of file RegisterTypeFlags.h.
Referenced by DumpToLog(), Field(), Field(), Field(), GetEnd(), GetSizeInBits(), and operator==().
|
private |
|
private |
Definition at line 120 of file RegisterTypeFlags.h.
Referenced by DumpToLog(), Field(), Field(), Field(), 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 RegisterTypeFlags.h.
Referenced by DumpToLog(), Field(), Field(), Field(), GetSizeInBits(), GetStart(), GetValue(), and operator==().