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 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 | 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 |
bool | Overlaps (const Field &other) const |
void | log (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 (StreamString &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 |
Private Attributes | |
std::string | m_name |
unsigned | m_start |
Start/end bit positions. | |
unsigned | m_end |
Definition at line 23 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 20 of file RegisterFlags.cpp.
|
inline |
Construct a field that occupies a single bit.
Definition at line 30 of file RegisterFlags.h.
|
inline |
Definition at line 48 of file RegisterFlags.h.
References m_end.
Referenced by Overlaps(), and ToXML().
|
inline |
A mask that covers all bits of the field.
Definition at line 37 of file RegisterFlags.h.
References GetSizeInBits(), and m_start.
Referenced by GetValue().
|
inline |
|
inline |
Get size of the field in bits. Will always be at least 1.
Definition at line 34 of file RegisterFlags.h.
References m_end, and m_start.
Referenced by GetMask(), and PaddingDistance().
|
inline |
Definition at line 47 of file RegisterFlags.h.
References m_start.
Referenced by operator<(), Overlaps(), PaddingDistance(), and ToXML().
|
inline |
Extract value of the field from a whole register value.
Definition at line 42 of file RegisterFlags.h.
void RegisterFlags::Field::log | ( | Log * | log | ) | const |
Definition at line 25 of file RegisterFlags.cpp.
References LLDB_LOG, and lldb_private::RegisterFlags::log().
|
inline |
Definition at line 61 of file RegisterFlags.h.
References GetStart().
|
inline |
Definition at line 65 of file RegisterFlags.h.
bool RegisterFlags::Field::Overlaps | ( | const Field & | other | ) | const |
Definition at line 30 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 36 of file RegisterFlags.cpp.
References GetSizeInBits(), and GetStart().
void RegisterFlags::Field::ToXML | ( | StreamString & | 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 216 of file RegisterFlags.cpp.
References GetEnd(), GetName(), GetStart(), lldb_private::Stream::Indent(), and lldb_private::Stream::Printf().
|
private |
Definition at line 77 of file RegisterFlags.h.
Referenced by Field(), GetEnd(), GetSizeInBits(), and operator==().
|
private |
Definition at line 71 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 76 of file RegisterFlags.h.
Referenced by Field(), GetMask(), GetSizeInBits(), GetStart(), GetValue(), and operator==().