Lines Matching full:field
21 RegisterFlags::Field::Field(std::string name, unsigned start, unsigned end) in Field() function in RegisterFlags::Field
27 RegisterFlags::Field::Field(std::string name, unsigned bit_position) in Field() function in RegisterFlags::Field
31 RegisterFlags::Field::Field(std::string name, unsigned start, unsigned end, in Field() function in RegisterFlags::Field
36 // Check that all values fit into this field. The XML parser will also in Field()
45 "Enumerator value exceeds maximum value for this field"); in Field()
50 void RegisterFlags::Field::DumpToLog(Log *log) const { in DumpToLog()
55 bool RegisterFlags::Field::Overlaps(const Field &other) const { in Overlaps()
61 unsigned RegisterFlags::Field::PaddingDistance(const Field &other) const { in PaddingDistance()
81 unsigned RegisterFlags::Field::GetSizeInBits(unsigned start, unsigned end) { in GetSizeInBits()
85 unsigned RegisterFlags::Field::GetSizeInBits() const { in GetSizeInBits()
89 uint64_t RegisterFlags::Field::GetMaxValue(unsigned start, unsigned end) { in GetMaxValue()
92 // If the field is >= 64 bits the shift below would be undefined. in GetMaxValue()
93 // We assume the GDB client has discarded any field that would fail this in GetMaxValue()
95 assert(bits <= 64 && "Cannot handle field with size > 64 bits"); in GetMaxValue()
102 uint64_t RegisterFlags::Field::GetMaxValue() const { in GetMaxValue()
106 uint64_t RegisterFlags::Field::GetMask() const { in GetMask()
110 void RegisterFlags::SetFields(const std::vector<Field> &fields) { in SetFields()
113 std::vector<Field> provided_fields = fields; in SetFields()
123 std::optional<Field> previous_field; in SetFields()
125 for (auto field : provided_fields) { in SetFields() local
127 unsigned padding = previous_field->PaddingDistance(field); in SetFields()
129 // -1 to end just before the previous field. in SetFields()
133 m_fields.push_back(Field("", field.GetEnd() + 1, end)); in SetFields()
136 // This is the first field. Check that it starts at the register's MSB. in SetFields()
137 if (field.GetEnd() != register_msb) in SetFields()
138 m_fields.push_back(Field("", field.GetEnd() + 1, register_msb)); in SetFields()
140 m_fields.push_back(field); in SetFields()
141 previous_field = field; in SetFields()
144 // The last field may not extend all the way to bit 0. in SetFields()
146 m_fields.push_back(Field("", 0, previous_field->GetStart() - 1)); in SetFields()
150 const std::vector<Field> &fields) in RegisterFlags()
157 for (const Field &field : m_fields) in DumpToLog() local
158 field.DumpToLog(log); in DumpToLog()
194 for (const RegisterFlags::Field &field : m_fields) { in AsTable() local
196 if (field.GetEnd() == field.GetStart()) in AsTable()
197 position.Printf(" %d ", field.GetEnd()); in AsTable()
199 position.Printf(" %d-%d ", field.GetEnd(), field.GetStart()); in AsTable()
202 name.Printf(" %s ", field.GetName().c_str()); in AsTable()
292 for (const auto &field : m_fields) { in DumpEnums() local
293 const FieldEnum *enum_type = field.GetEnum(); in DumpEnums()
307 std::string name_string = field.GetName() + ": "; in DumpEnums()
320 for (const Field &field : m_fields) in EnumsToXML() local
321 if (const FieldEnum *enum_type = field.GetEnum()) { in EnumsToXML()
382 // <field name="incorrect" start="0" end="0"/> in ToXML()
388 for (const Field &field : m_fields) { in ToXML() local
390 if (field.GetName().empty()) in ToXML()
395 field.ToXML(strm); in ToXML()
402 void RegisterFlags::Field::ToXML(Stream &strm) const { in ToXML()
404 // <field name="correct" start="0" end="0" type="some_enum"> in ToXML()
406 // <field name="correct" start="0" end="0"/> in ToXML()
408 strm << "<field name=\""; in ToXML()