LLDB mainline
|
#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. | |
std::string | DumpEnums (uint32_t max_width) const |
Make a string where each line contains the name of a field that has enum values, and lists what those values are. | |
template<typename T > | |
T | ReverseFieldOrder (T value) const |
const std::vector< Field > & | GetFields () const |
const std::string & | GetID () const |
unsigned | GetSize () const |
void | DumpToLog (Log *log) const |
std::string | AsTable (uint32_t max_width) const |
Produce a text table showing the layout of all the fields. | |
void | ToXML (Stream &strm) const |
Output XML that describes this set of flags. | |
void | EnumsToXML (Stream &strm, llvm::StringSet<> &seen) const |
Enum types must be defined before use, and GDBRemoteCommunicationServerLLGS view of the register types is based only on the registers. | |
Private Attributes | |
const std::string | m_id |
const unsigned | m_size |
Size in bytes. | |
std::vector< Field > | m_fields |
Definition at line 59 of file RegisterFlags.h.
RegisterFlags::RegisterFlags | ( | std::string | id, |
unsigned | size, | ||
const std::vector< Field > & | fields | ||
) |
This assumes that:
Definition at line 149 of file RegisterFlags.cpp.
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 188 of file RegisterFlags.cpp.
References EmitTable(), FormatCell(), lldb_private::StreamString::GetString(), m_fields, and lldb_private::Stream::Printf().
std::string RegisterFlags::DumpEnums | ( | uint32_t | max_width | ) | const |
Make a string where each line contains the name of a field that has enum values, and lists what those values are.
Definition at line 288 of file RegisterFlags.cpp.
References DumpEnumerators(), lldb_private::FieldEnum::GetEnumerators(), lldb_private::StreamString::GetString(), and m_fields.
void RegisterFlags::DumpToLog | ( | Log * | log | ) | const |
Definition at line 155 of file RegisterFlags.cpp.
void RegisterFlags::EnumsToXML | ( | Stream & | strm, |
llvm::StringSet<> & | seen | ||
) | const |
Enum types must be defined before use, and GDBRemoteCommunicationServerLLGS view of the register types is based only on the registers.
So this method emits any enum types that the upcoming set of fields may need. "seen" is a set of Enum IDs that we have already printed, that is updated with any printed by this call. This prevents us printing the same enum multiple times.
Definition at line 319 of file RegisterFlags.cpp.
References GetSize(), and m_fields.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml().
|
inline |
Definition at line 165 of file RegisterFlags.h.
References m_fields.
Referenced by lldb_private::RegisterTypeBuilderClang::GetRegisterType(), and ReverseFieldOrder().
|
inline |
Definition at line 166 of file RegisterFlags.h.
References m_id.
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml(), ToXML(), and lldb_private::FieldEnum::ToXML().
|
inline |
Definition at line 167 of file RegisterFlags.h.
References m_size.
Referenced by EnumsToXML(), lldb_private::RegisterTypeBuilderClang::GetRegisterType(), and ToXML().
|
inline |
Definition at line 154 of file RegisterFlags.h.
References GetFields().
Referenced by dump_type_value().
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 110 of file RegisterFlags.cpp.
void RegisterFlags::ToXML | ( | Stream & | strm | ) | const |
Output XML that describes this set of flags.
EnumsToXML should have been called before this.
Definition at line 379 of file RegisterFlags.cpp.
References GetID(), GetSize(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_fields, lldb_private::Stream::Printf(), and lldb_private::Stream::PutChar().
Referenced by lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::BuildTargetXml().
|
private |
Definition at line 193 of file RegisterFlags.h.
Referenced by AsTable(), DumpEnums(), EnumsToXML(), GetFields(), and ToXML().
|
private |
Definition at line 190 of file RegisterFlags.h.
Referenced by lldb_private::FieldEnum::DumpToLog(), and GetID().
|
private |