aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.xml
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-12-01 11:07:12 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-12-01 11:22:24 +0000
commit54e75f291ef10f2ccb0549b25e0d9d207b325c79 (patch)
treeb57a8e8bc2fc5adaccaf191fc470d7c3a0ac0bdf /gdb/testsuite/gdb.xml
parent4f36e61b2dee8de793b09670378229dfe2750803 (diff)
downloadfsf-binutils-gdb-54e75f291ef10f2ccb0549b25e0d9d207b325c79.zip
fsf-binutils-gdb-54e75f291ef10f2ccb0549b25e0d9d207b325c79.tar.gz
fsf-binutils-gdb-54e75f291ef10f2ccb0549b25e0d9d207b325c79.tar.bz2
gdbsupport/tdesc: print enum fields using 'evalue' syntax
Currently when printing an XML description GDB prints enum values like this: <enum id="levels_type" size="4"> <field name="low" start="0"/> <field name="high" start="1"/> </enum> This is incorrect, and is most likely a copy and paste error with the struct and flags printing code. The correct syntax is: <enum id="levels_type" size="4"> <evalue name="low" value="0"/> <evalue name="high" value="1"/> </enum> A test is included to cover this functionality. gdb/testsuite/ChangeLog: * gdb.xml/maint-xml-dump-03.xml: New file. gdbsupport/ChangeLog: * tdesc.cc (print_xml_feature::visit): Print enum fields using 'evalue' syntax.
Diffstat (limited to 'gdb/testsuite/gdb.xml')
-rw-r--r--gdb/testsuite/gdb.xml/maint-xml-dump-03.xml13
1 files changed, 13 insertions, 0 deletions
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>