[Lldb-commits] [lldb] [lldb] Parse and display register field enums (PR #95768)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 26 06:54:01 PDT 2024


================
@@ -4179,21 +4179,124 @@ struct GdbServerTargetInfo {
   RegisterSetMap reg_set_map;
 };
 
-static std::vector<RegisterFlags::Field> ParseFlagsFields(XMLNode flags_node,
-                                                          unsigned size) {
+static FieldEnum::Enumerators ParseEnumEvalues(const XMLNode &enum_node) {
+  Log *log(GetLog(GDBRLog::Process));
+  // We will use the last instance of each value. Also we preserve the order
+  // of declaration in the XML, as it may not be numerical.
+  std::map<uint64_t, FieldEnum::Enumerator> enumerators;
----------------
DavidSpickett wrote:

I've expanded the comment anyway.

I don't think anyone on the GDB side ever considered that order might matter, because I don't think they have a `register info` equivalent. You can print the type of the register but that's more of a C type, where enumerators being sorted isn't unexpected.

https://github.com/llvm/llvm-project/pull/95768


More information about the lldb-commits mailing list