aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-07-19 15:02:41 +0100
committerAlan Hayward <alan.hayward@arm.com>2019-07-19 15:02:41 +0100
commitf42b26179a8606d31959207a2d8eb8582b650c99 (patch)
treef3b3fc3118c17a261d6b01fb79d7b9f9b039b45d /gdb
parentf29ec966436f98e761f7a2a7183ad8ebab68c2ea (diff)
downloadgdb-f42b26179a8606d31959207a2d8eb8582b650c99.zip
gdb-f42b26179a8606d31959207a2d8eb8582b650c99.tar.gz
gdb-f42b26179a8606d31959207a2d8eb8582b650c99.tar.bz2
Arm: Add xml unit tests
Use the record_xml_tdesc tests to prove the new target descriptions are identical to the previous xml file ones. This is tested as part of gdb.gdb/unittest.exp. gdb/ChangeLog: * arm-tdep.c (_initialize_arm_tdep): Add xml regression tests.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/arm-tdep.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 994e0ef..102af2e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2019-07-19 Alan Hayward <alan.hayward@arm.com>
+ * arm-tdep.c (_initialize_arm_tdep): Add xml regression tests.
+
+2019-07-19 Alan Hayward <alan.hayward@arm.com>
+
* arch/aarch32.c (aarch32_create_target_description): Create
target descriptions using features.
* arch/arm.c (arm_create_target_description)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 1d655ea..b500f19 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -63,6 +63,7 @@
#if GDB_SELF_TEST
#include "gdbsupport/selftest.h"
+#include "aarch32-tdep.h"
#endif
static int arm_debug;
@@ -9547,6 +9548,23 @@ vfp - VFP co-processor."),
#if GDB_SELF_TEST
selftests::register_test ("arm-record", selftests::arm_record_test);
+
+ const target_desc *tdesc;
+
+ tdesc = arm_read_description (ARM_FP_TYPE_VFPV2);
+ selftests::record_xml_tdesc ("arm/arm-with-vfpv2.xml", tdesc);
+ tdesc = arm_read_description (ARM_FP_TYPE_VFPV3);
+ selftests::record_xml_tdesc ("arm/arm-with-vfpv3.xml",tdesc);
+ tdesc = arm_read_description (ARM_FP_TYPE_IWMMXT);
+ selftests::record_xml_tdesc ("arm/arm-with-iwmmxt.xml", tdesc);
+ tdesc = arm_read_mprofile_description (ARM_M_TYPE_M_PROFILE);
+ selftests::record_xml_tdesc ("arm/arm-with-m.xml", tdesc);
+ tdesc = arm_read_mprofile_description (ARM_M_TYPE_VFP_D16);
+ selftests::record_xml_tdesc ("arm/arm-with-m-vfp-d16.xml", tdesc);
+ tdesc = arm_read_mprofile_description (ARM_M_TYPE_WITH_FPA);
+ selftests::record_xml_tdesc ("arm/arm-with-m-fpa-layout.xml", tdesc);
+ tdesc = aarch32_read_description ();
+ selftests::record_xml_tdesc ("arm/arm-with-neon.xml", tdesc);
#endif
}