aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.xml/maint-xml-dump-03.xml13
-rw-r--r--gdbsupport/ChangeLog5
-rw-r--r--gdbsupport/tdesc.cc4
4 files changed, 25 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 882d02f..5966355 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2020-12-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.xml/maint-xml-dump-03.xml: New file.
+
2020-11-30 Tom de Vries <tdevries@suse.de>
PR symtab/26905
diff --git a/gdb/testsuite/gdb.xml/maint-xml-dump-03.xml b/gdb/testsuite/gdb.xml/maint-xml-dump-03.xml
new file mode 100644
index 0000000..89741e6
--- /dev/null
+++ b/gdb/testsuite/gdb.xml/maint-xml-dump-03.xml
@@ -0,0 +1,13 @@
+<target>
+ <feature name="abc">
+ <enum id="levels_type" size="4">
+ <evalue name="low" value="0"/>
+ <evalue name="high" value="1"/>
+ </enum>
+ <flags id="flags_type" size="4">
+ <field name="X" start="0" end="0" type="bool"/>
+ <field name="LEVEL" start="1" end="1" type="levels_type"/>
+ </flags>
+ <reg name="flags" bitsize="32" type="flags_type" regnum="0"/>
+ </feature>
+</target>
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
index a77f1c9..88a0413 100644
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-01 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * tdesc.cc (print_xml_feature::visit): Print enum fields using
+ 'evalue' syntax.
+
2020-12-01 Chungyi Chi <demonic@csie.io>
* tdesc.cc (print_xml_feature::visit): Print enum size attribute.
diff --git a/gdbsupport/tdesc.cc b/gdbsupport/tdesc.cc
index 2bc0247..c062a77 100644
--- a/gdbsupport/tdesc.cc
+++ b/gdbsupport/tdesc.cc
@@ -355,8 +355,10 @@ void print_xml_feature::visit (const tdesc_type_with_fields *t)
string_appendf (tmp, " size=\"%d\"", t->size);
string_appendf (tmp, ">");
add_line (tmp);
+ /* The 'start' of the field is reused as the enum value. The 'end'
+ of the field is always set to -1 for enum values. */
for (const tdesc_type_field &f : t->fields)
- add_line (" <field name=\"%s\" start=\"%d\"/>",
+ add_line (" <evalue name=\"%s\" value=\"%d\"/>",
f.name.c_str (), f.start);
break;