[2/7] Arm: Create feature files for Arm target descriptions

Message ID 20190705094525.51536-3-alan.hayward@arm.com
State New
Headers show
Series
  • Arm: Use feature target descriptions
Related show

Commit Message

Alan Hayward July 5, 2019, 9:45 a.m.
Add Arm to the list of feature target description targets and generate the
relevant C files.

Add arm-m-profile-with-fpa.xml as the feature version of the exisiting
arm-with-m-fpa-layout.xml.

Add extra comments to the Makefile for readability.

New files are not yet used.

gdb/ChangeLog:

2019-07-05  Alan Hayward  <alan.hayward@arm.com>

	* features/Makefile: Use feature target descriptions for Arm.
	* features/arm/arm-core.c: Generate new file.
	* features/arm/arm-fpa.c: Likewise.
	* features/arm/arm-m-profile-with-fpa.xml: Likewise.
	* features/arm/arm-m-profile.c: Likewise.
	* features/arm/arm-vfpv2.c: Likewise.
	* features/arm/arm-vfpv3.c: Likewise.
	* features/arm/xscale-iwmmxt.c: Likewise.
	* target-descriptions.c (maint_print_c_tdesc_cmd): Add Arm.
---
 gdb/features/Makefile                       | 30 ++++++-----
 gdb/features/arm/arm-core.c                 | 31 +++++++++++
 gdb/features/arm/arm-fpa.c                  | 23 +++++++++
 gdb/features/arm/arm-m-profile-with-fpa.c   | 39 ++++++++++++++
 gdb/features/arm/arm-m-profile-with-fpa.xml | 39 ++++++++++++++
 gdb/features/arm/arm-m-profile.c            | 31 +++++++++++
 gdb/features/arm/arm-vfpv2.c                | 30 +++++++++++
 gdb/features/arm/arm-vfpv3.c                | 46 +++++++++++++++++
 gdb/features/arm/xscale-iwmmxt.c            | 57 +++++++++++++++++++++
 gdb/target-descriptions.c                   |  3 +-
 10 files changed, 314 insertions(+), 15 deletions(-)
 create mode 100644 gdb/features/arm/arm-core.c
 create mode 100644 gdb/features/arm/arm-fpa.c
 create mode 100644 gdb/features/arm/arm-m-profile-with-fpa.c
 create mode 100644 gdb/features/arm/arm-m-profile-with-fpa.xml
 create mode 100644 gdb/features/arm/arm-m-profile.c
 create mode 100644 gdb/features/arm/arm-vfpv2.c
 create mode 100644 gdb/features/arm/arm-vfpv3.c
 create mode 100644 gdb/features/arm/xscale-iwmmxt.c

-- 
2.20.1 (Apple Git-117)

Comments

Simon Marchi July 10, 2019, 2:56 a.m. | #1
On 2019-07-05 5:45 a.m., Alan Hayward wrote:
> Add Arm to the list of feature target description targets and generate the

> relevant C files.

> 

> Add arm-m-profile-with-fpa.xml as the feature version of the exisiting

> arm-with-m-fpa-layout.xml.

> 

> Add extra comments to the Makefile for readability.

> 

> New files are not yet used.


Hi Alan,

Note that you'll need to re-generate these files following the renaming
of common to gdbsupport.  It should not be a big deal though.

However, when I try to re-generate the C files, I get this spurious diff:

diff --git a/gdb/features/aarch64-pauth.c b/gdb/features/aarch64-pauth.c
index 931e6cb28410..7bd73a6b21d9 100644
--- a/gdb/features/aarch64-pauth.c
+++ b/gdb/features/aarch64-pauth.c
@@ -11,6 +11,5 @@ create_feature_aarch64_pauth (struct target_desc *result, long regnum)
   feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.pauth");
   tdesc_create_reg (feature, "pauth_dmask", regnum++, 1, NULL, 64, "int");
   tdesc_create_reg (feature, "pauth_cmask", regnum++, 1, NULL, 64, "int");
-
   return regnum;
 }

Do you see it too?  If so, would you mind just pushing an obvious patch to
fix it?

This patch LGTM, at least the features/Makefile and target-descriptions.c parts
(the arm parts look good too but I don't really know the specifics of the
architecture).

Thanks!

Simon
Alan Hayward July 10, 2019, 1:22 p.m. | #2
> On 10 Jul 2019, at 03:56, Simon Marchi <simark@simark.ca> wrote:

> 

> On 2019-07-05 5:45 a.m., Alan Hayward wrote:

>> Add Arm to the list of feature target description targets and generate the

>> relevant C files.

>> 

>> Add arm-m-profile-with-fpa.xml as the feature version of the exisiting

>> arm-with-m-fpa-layout.xml.

>> 

>> Add extra comments to the Makefile for readability.

>> 

>> New files are not yet used.

> 

> Hi Alan,

> 

> Note that you'll need to re-generate these files following the renaming

> of common to gdbsupport.  It should not be a big deal though.

> 

> However, when I try to re-generate the C files, I get this spurious diff:

> 

> diff --git a/gdb/features/aarch64-pauth.c b/gdb/features/aarch64-pauth.c

> index 931e6cb28410..7bd73a6b21d9 100644

> --- a/gdb/features/aarch64-pauth.c

> +++ b/gdb/features/aarch64-pauth.c

> @@ -11,6 +11,5 @@ create_feature_aarch64_pauth (struct target_desc *result, long regnum)

>   feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.pauth");

>   tdesc_create_reg (feature, "pauth_dmask", regnum++, 1, NULL, 64, "int");

>   tdesc_create_reg (feature, "pauth_cmask", regnum++, 1, NULL, 64, "int");

> -

>   return regnum;

> }

> 

> Do you see it too?  If so, would you mind just pushing an obvious patch to

> fix it?

> 


Not quite sure how that happened. But fixed up now.


> This patch LGTM, at least the features/Makefile and target-descriptions.c parts

> (the arm parts look good too but I don't really know the specifics of the

> architecture).

> 

> 


Thanks.
I pushed 1/7 because the changes were obvious.

I regenerated this patch and pushed. Pasted below for reference.

Alan.



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6686a14c4b..0c2dca7c5d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2019-07-10  Alan Hayward  <alan.hayward@arm.com>
+
+       * features/Makefile: Use feature target descriptions for Arm.
+       * features/arm/arm-core.c: Generate new file.
+       * features/arm/arm-fpa.c: Likewise.
+       * features/arm/arm-m-profile-with-fpa.xml: Likewise.
+       * features/arm/arm-m-profile.c: Likewise.
+       * features/arm/arm-vfpv2.c: Likewise.
+       * features/arm/arm-vfpv3.c: Likewise.
+       * features/arm/xscale-iwmmxt.c: Likewise.
+       * target-descriptions.c (maint_print_c_tdesc_cmd): Add Arm.
+
 2019-07-10  Alan Hayward  <alan.hayward@arm.com>

        * arm-linux-nat.c (arm_linux_nat_target::read_description): Check
diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index 3b57124b04..0c84faf405 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -38,11 +38,12 @@
 #
 #   make GDB=/path/to/gdb clean-cfiles cfiles
 #
-# To generate specific C files, you can override the XMLTOC make
-# variable:
+# To generate specific C files, you can override the XMLTOC and
+# FEATURE_XMLFILES make variables:
 #
-#   make GDB=/path/to/gdb XMLTOC="xml files" cfiles
+#   make GDB=/path/to/gdb XMLTOC="xml files" FEATURE_XMLFILES="xml files" cfiles

+# List of .dat files to create in ../regformats/
 WHICH = arm/arm-with-iwmmxt arm/arm-with-vfpv2 arm/arm-with-vfpv3 \
        arm/arm-with-neon \
        mips-linux mips-dsp-linux \
@@ -103,20 +104,14 @@ XSLTPROC = xsltproc
 outdir = ../regformats
 OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))

-# The set of xml files we'll generate .c files for GDB from.  By
+# For targets without feature based target descriptions,
+# the set of xml files we'll generate .c files for GDB from.  By
 # default we'll build all .c files, which requires an
 # --enable-targets=all GDB.  You can override this by passing XMLTOC
 # to make on the command line.
 XMLTOC = \
        arc-v2.xml \
        arc-arcompact.xml \
-       arm/arm-with-iwmmxt.xml \
-       arm/arm-with-m-fpa-layout.xml \
-       arm/arm-with-m-vfp-d16.xml \
-       arm/arm-with-m.xml \
-       arm/arm-with-neon.xml \
-       arm/arm-with-vfpv2.xml \
-       arm/arm-with-vfpv3.xml \
        microblaze-with-stack-protect.xml \
        microblaze.xml \
        mips-dsp-linux.xml \
@@ -189,6 +184,7 @@ GDB = false

 #Targets which use feature based target descriptions.
 aarch64-feature = 1
+arm-feature = 1
 i386-feature = 1
 riscv-feature = 1
 tic6x-feature = 1
@@ -208,9 +204,18 @@ $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
          $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp
        sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat

+# For targets with feature based target descriptions,
+# the set of xml files we'll generate .c files for GDB from.
 FEATURE_XMLFILES = aarch64-core.xml \
        aarch64-fpu.xml \
        aarch64-pauth.xml \
+       arm/arm-core.xml \
+       arm/arm-fpa.xml \
+       arm/arm-m-profile.xml \
+       arm/arm-m-profile-with-fpa.xml \
+       arm/arm-vfpv2.xml \
+       arm/arm-vfpv3.xml \
+       arm/xscale-iwmmxt.xml \
        i386/32bit-core.xml \
        i386/32bit-sse.xml \
        i386/32bit-linux.xml \
@@ -263,9 +268,6 @@ $(FEATURE_CFILES): %.c: %.xml.tmp
        echo "</target>" >> $@.tmp
        sh ../../move-if-change $@.tmp $@

-# Other dependencies.
-$(outdir)/arm/arm-with-iwmmxt.dat: arm/arm-core.xml arm/xscale-iwmmxt.xml
-
 # Regenerate RISC-V CSR feature lists.
 riscv/32bit-csr.xml riscv/64bit-csr.xml: ../../include/opcode/riscv-opc.h
        ./riscv/rebuild-csr-xml.sh ../../include/opcode/riscv-opc.h ./riscv
diff --git a/gdb/features/arm/arm-core.c b/gdb/features/arm/arm-core.c
new file mode 100644
index 0000000000..e401411fc5
--- /dev/null
+++ b/gdb/features/arm/arm-core.c
@@ -0,0 +1,31 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-core.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_arm_core (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
+  tdesc_create_reg (feature, "r0", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r1", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r2", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r3", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r4", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r5", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r6", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r7", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r8", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r9", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r10", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r11", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r12", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 32, "code_ptr");
+  regnum = 25;
+  tdesc_create_reg (feature, "cpsr", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-fpa.c b/gdb/features/arm/arm-fpa.c
new file mode 100644
index 0000000000..65a49f5f3f
--- /dev/null
+++ b/gdb/features/arm/arm-fpa.c
@@ -0,0 +1,23 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-fpa.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_arm_fpa (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.fpa");
+  regnum = 16;
+  tdesc_create_reg (feature, "f0", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f1", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f2", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f3", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f4", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f5", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f6", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f7", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "fps", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-m-profile-with-fpa.c b/gdb/features/arm/arm-m-profile-with-fpa.c
new file mode 100644
index 0000000000..2b7c78597b
--- /dev/null
+++ b/gdb/features/arm/arm-m-profile-with-fpa.c
@@ -0,0 +1,39 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-m-profile-with-fpa.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_arm_m_profile_with_fpa (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
+  tdesc_create_reg (feature, "r0", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r1", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r2", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r3", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r4", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r5", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r6", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r7", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r8", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r9", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r10", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r11", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r12", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 32, "code_ptr");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "xpsr", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-m-profile-with-fpa.xml b/gdb/features/arm/arm-m-profile-with-fpa.xml
new file mode 100644
index 0000000000..91e183c2dc
--- /dev/null
+++ b/gdb/features/arm/arm-m-profile-with-fpa.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2019 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.arm.m-profile">
+  <reg name="r0" bitsize="32"/>
+  <reg name="r1" bitsize="32"/>
+  <reg name="r2" bitsize="32"/>
+  <reg name="r3" bitsize="32"/>
+  <reg name="r4" bitsize="32"/>
+  <reg name="r5" bitsize="32"/>
+  <reg name="r6" bitsize="32"/>
+  <reg name="r7" bitsize="32"/>
+  <reg name="r8" bitsize="32"/>
+  <reg name="r9" bitsize="32"/>
+  <reg name="r10" bitsize="32"/>
+  <reg name="r11" bitsize="32"/>
+  <reg name="r12" bitsize="32"/>
+  <reg name="sp" bitsize="32" type="data_ptr"/>
+  <reg name="lr" bitsize="32"/>
+  <reg name="pc" bitsize="32" type="code_ptr"/>
+
+  <!-- Slack for unused FPA registers (f0-f7 + fps).  -->
+  <reg name="" bitsize="96" type="arm_fpa_ext" regnum="16"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="32"/>
+
+  <reg name="xpsr" bitsize="32" regnum="25"/>
+</feature>
diff --git a/gdb/features/arm/arm-m-profile.c b/gdb/features/arm/arm-m-profile.c
new file mode 100644
index 0000000000..027f3c15c5
--- /dev/null
+++ b/gdb/features/arm/arm-m-profile.c
@@ -0,0 +1,31 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-m-profile.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_arm_m_profile (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
+  tdesc_create_reg (feature, "r0", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r1", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r2", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r3", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r4", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r5", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r6", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r7", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r8", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r9", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r10", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r11", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r12", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 32, "code_ptr");
+  regnum = 25;
+  tdesc_create_reg (feature, "xpsr", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-vfpv2.c b/gdb/features/arm/arm-vfpv2.c
new file mode 100644
index 0000000000..d6f8e79212
--- /dev/null
+++ b/gdb/features/arm/arm-vfpv2.c
@@ -0,0 +1,30 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-vfpv2.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_arm_vfpv2 (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.vfp");
+  tdesc_create_reg (feature, "d0", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d1", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d2", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d3", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d4", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d5", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d6", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d7", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d8", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d9", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d10", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d11", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d12", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d13", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d14", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d15", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fpscr", regnum++, 1, "float", 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-vfpv3.c b/gdb/features/arm/arm-vfpv3.c
new file mode 100644
index 0000000000..b5ef4bae14
--- /dev/null
+++ b/gdb/features/arm/arm-vfpv3.c
@@ -0,0 +1,46 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-vfpv3.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_arm_vfpv3 (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.vfp");
+  tdesc_create_reg (feature, "d0", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d1", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d2", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d3", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d4", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d5", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d6", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d7", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d8", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d9", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d10", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d11", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d12", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d13", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d14", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d15", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d16", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d17", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d18", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d19", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d20", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d21", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d22", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d23", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d24", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d25", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d26", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d27", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d28", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d29", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d30", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d31", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fpscr", regnum++, 1, "float", 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/xscale-iwmmxt.c b/gdb/features/arm/xscale-iwmmxt.c
new file mode 100644
index 0000000000..797fb9190a
--- /dev/null
+++ b/gdb/features/arm/xscale-iwmmxt.c
@@ -0,0 +1,57 @@
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: xscale-iwmmxt.xml */
+
+#include "gdbsupport/tdesc.h"
+
+static int
+create_feature_arm_xscale_iwmmxt (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.xscale.iwmmxt");
+  tdesc_type *element_type;
+  element_type = tdesc_named_type (feature, "uint8");
+  tdesc_create_vector (feature, "iwmmxt_v8u8", element_type, 8);
+
+  element_type = tdesc_named_type (feature, "uint16");
+  tdesc_create_vector (feature, "iwmmxt_v4u16", element_type, 4);
+
+  element_type = tdesc_named_type (feature, "uint32");
+  tdesc_create_vector (feature, "iwmmxt_v2u32", element_type, 2);
+
+  tdesc_type_with_fields *type_with_fields;
+  type_with_fields = tdesc_create_union (feature, "iwmmxt_vec64i");
+  tdesc_type *field_type;
+  field_type = tdesc_named_type (feature, "iwmmxt_v8u8");
+  tdesc_add_field (type_with_fields, "u8", field_type);
+  field_type = tdesc_named_type (feature, "iwmmxt_v4u16");
+  tdesc_add_field (type_with_fields, "u16", field_type);
+  field_type = tdesc_named_type (feature, "iwmmxt_v2u32");
+  tdesc_add_field (type_with_fields, "u32", field_type);
+  field_type = tdesc_named_type (feature, "uint64");
+  tdesc_add_field (type_with_fields, "u64", field_type);
+
+  tdesc_create_reg (feature, "wR0", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR1", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR2", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR3", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR4", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR5", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR6", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR7", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR8", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR9", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR10", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR11", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR12", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR13", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR14", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR15", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wCSSF", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCASF", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR0", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR1", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR2", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR3", regnum++, 1, "vector", 32, "int");
+  return regnum;
+}
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index f422f2c14c..322ed509b1 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -1715,7 +1715,8 @@ maint_print_c_tdesc_cmd (const char *args, int from_tty)
       || startswith (filename_after_features.c_str (), "i386/x32-core.xml")
       || startswith (filename_after_features.c_str (), "riscv/")
       || startswith (filename_after_features.c_str (), "tic6x-")
-      || startswith (filename_after_features.c_str (), "aarch64"))
+      || startswith (filename_after_features.c_str (), "aarch64")
+      || startswith (filename_after_features.c_str (), "arm/"))
     {
       print_c_feature v (filename_after_features);

Patch

diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index 3b57124b04..0c84faf405 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -38,11 +38,12 @@ 
 #
 #   make GDB=/path/to/gdb clean-cfiles cfiles
 #
-# To generate specific C files, you can override the XMLTOC make
-# variable:
+# To generate specific C files, you can override the XMLTOC and
+# FEATURE_XMLFILES make variables:
 #
-#   make GDB=/path/to/gdb XMLTOC="xml files" cfiles
+#   make GDB=/path/to/gdb XMLTOC="xml files" FEATURE_XMLFILES="xml files" cfiles
 
+# List of .dat files to create in ../regformats/
 WHICH = arm/arm-with-iwmmxt arm/arm-with-vfpv2 arm/arm-with-vfpv3 \
 	arm/arm-with-neon \
 	mips-linux mips-dsp-linux \
@@ -103,20 +104,14 @@  XSLTPROC = xsltproc
 outdir = ../regformats
 OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))
 
-# The set of xml files we'll generate .c files for GDB from.  By
+# For targets without feature based target descriptions,
+# the set of xml files we'll generate .c files for GDB from.  By
 # default we'll build all .c files, which requires an
 # --enable-targets=all GDB.  You can override this by passing XMLTOC
 # to make on the command line.
 XMLTOC = \
 	arc-v2.xml \
 	arc-arcompact.xml \
-	arm/arm-with-iwmmxt.xml \
-	arm/arm-with-m-fpa-layout.xml \
-	arm/arm-with-m-vfp-d16.xml \
-	arm/arm-with-m.xml \
-	arm/arm-with-neon.xml \
-	arm/arm-with-vfpv2.xml \
-	arm/arm-with-vfpv3.xml \
 	microblaze-with-stack-protect.xml \
 	microblaze.xml \
 	mips-dsp-linux.xml \
@@ -189,6 +184,7 @@  GDB = false
 
 #Targets which use feature based target descriptions.
 aarch64-feature = 1
+arm-feature = 1
 i386-feature = 1
 riscv-feature = 1
 tic6x-feature = 1
@@ -208,9 +204,18 @@  $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
 	  $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp
 	sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat
 
+# For targets with feature based target descriptions,
+# the set of xml files we'll generate .c files for GDB from.
 FEATURE_XMLFILES = aarch64-core.xml \
 	aarch64-fpu.xml \
 	aarch64-pauth.xml \
+	arm/arm-core.xml \
+	arm/arm-fpa.xml \
+	arm/arm-m-profile.xml \
+	arm/arm-m-profile-with-fpa.xml \
+	arm/arm-vfpv2.xml \
+	arm/arm-vfpv3.xml \
+	arm/xscale-iwmmxt.xml \
 	i386/32bit-core.xml \
 	i386/32bit-sse.xml \
 	i386/32bit-linux.xml \
@@ -263,9 +268,6 @@  $(FEATURE_CFILES): %.c: %.xml.tmp
 	echo "</target>" >> $@.tmp
 	sh ../../move-if-change $@.tmp $@
 
-# Other dependencies.
-$(outdir)/arm/arm-with-iwmmxt.dat: arm/arm-core.xml arm/xscale-iwmmxt.xml
-
 # Regenerate RISC-V CSR feature lists.
 riscv/32bit-csr.xml riscv/64bit-csr.xml: ../../include/opcode/riscv-opc.h
 	./riscv/rebuild-csr-xml.sh ../../include/opcode/riscv-opc.h ./riscv
diff --git a/gdb/features/arm/arm-core.c b/gdb/features/arm/arm-core.c
new file mode 100644
index 0000000000..d2f26d6f80
--- /dev/null
+++ b/gdb/features/arm/arm-core.c
@@ -0,0 +1,31 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-core.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_arm_core (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
+  tdesc_create_reg (feature, "r0", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r1", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r2", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r3", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r4", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r5", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r6", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r7", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r8", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r9", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r10", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r11", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "r12", regnum++, 1, NULL, 32, "uint32");
+  tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 32, "code_ptr");
+  regnum = 25;
+  tdesc_create_reg (feature, "cpsr", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-fpa.c b/gdb/features/arm/arm-fpa.c
new file mode 100644
index 0000000000..1988c376a4
--- /dev/null
+++ b/gdb/features/arm/arm-fpa.c
@@ -0,0 +1,23 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-fpa.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_arm_fpa (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.fpa");
+  regnum = 16;
+  tdesc_create_reg (feature, "f0", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f1", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f2", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f3", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f4", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f5", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f6", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "f7", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "fps", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-m-profile-with-fpa.c b/gdb/features/arm/arm-m-profile-with-fpa.c
new file mode 100644
index 0000000000..ea6b098935
--- /dev/null
+++ b/gdb/features/arm/arm-m-profile-with-fpa.c
@@ -0,0 +1,39 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-m-profile-with-fpa.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_arm_m_profile_with_fpa (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
+  tdesc_create_reg (feature, "r0", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r1", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r2", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r3", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r4", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r5", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r6", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r7", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r8", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r9", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r10", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r11", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r12", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 32, "code_ptr");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 96, "arm_fpa_ext");
+  tdesc_create_reg (feature, "", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "xpsr", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-m-profile-with-fpa.xml b/gdb/features/arm/arm-m-profile-with-fpa.xml
new file mode 100644
index 0000000000..91e183c2dc
--- /dev/null
+++ b/gdb/features/arm/arm-m-profile-with-fpa.xml
@@ -0,0 +1,39 @@ 
+<?xml version="1.0"?>
+<!-- Copyright (C) 2019 Free Software Foundation, Inc.
+
+     Copying and distribution of this file, with or without modification,
+     are permitted in any medium without royalty provided the copyright
+     notice and this notice are preserved.  -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.arm.m-profile">
+  <reg name="r0" bitsize="32"/>
+  <reg name="r1" bitsize="32"/>
+  <reg name="r2" bitsize="32"/>
+  <reg name="r3" bitsize="32"/>
+  <reg name="r4" bitsize="32"/>
+  <reg name="r5" bitsize="32"/>
+  <reg name="r6" bitsize="32"/>
+  <reg name="r7" bitsize="32"/>
+  <reg name="r8" bitsize="32"/>
+  <reg name="r9" bitsize="32"/>
+  <reg name="r10" bitsize="32"/>
+  <reg name="r11" bitsize="32"/>
+  <reg name="r12" bitsize="32"/>
+  <reg name="sp" bitsize="32" type="data_ptr"/>
+  <reg name="lr" bitsize="32"/>
+  <reg name="pc" bitsize="32" type="code_ptr"/>
+
+  <!-- Slack for unused FPA registers (f0-f7 + fps).  -->
+  <reg name="" bitsize="96" type="arm_fpa_ext" regnum="16"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="96" type="arm_fpa_ext"/>
+  <reg name="" bitsize="32"/>
+
+  <reg name="xpsr" bitsize="32" regnum="25"/>
+</feature>
diff --git a/gdb/features/arm/arm-m-profile.c b/gdb/features/arm/arm-m-profile.c
new file mode 100644
index 0000000000..ea14528fc7
--- /dev/null
+++ b/gdb/features/arm/arm-m-profile.c
@@ -0,0 +1,31 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-m-profile.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_arm_m_profile (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
+  tdesc_create_reg (feature, "r0", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r1", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r2", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r3", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r4", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r5", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r6", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r7", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r8", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r9", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r10", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r11", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "r12", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "sp", regnum++, 1, NULL, 32, "data_ptr");
+  tdesc_create_reg (feature, "lr", regnum++, 1, NULL, 32, "int");
+  tdesc_create_reg (feature, "pc", regnum++, 1, NULL, 32, "code_ptr");
+  regnum = 25;
+  tdesc_create_reg (feature, "xpsr", regnum++, 1, NULL, 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-vfpv2.c b/gdb/features/arm/arm-vfpv2.c
new file mode 100644
index 0000000000..db5c16bb1d
--- /dev/null
+++ b/gdb/features/arm/arm-vfpv2.c
@@ -0,0 +1,30 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-vfpv2.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_arm_vfpv2 (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.vfp");
+  tdesc_create_reg (feature, "d0", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d1", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d2", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d3", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d4", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d5", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d6", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d7", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d8", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d9", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d10", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d11", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d12", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d13", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d14", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d15", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fpscr", regnum++, 1, "float", 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/arm-vfpv3.c b/gdb/features/arm/arm-vfpv3.c
new file mode 100644
index 0000000000..93e5f3cc36
--- /dev/null
+++ b/gdb/features/arm/arm-vfpv3.c
@@ -0,0 +1,46 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: arm-vfpv3.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_arm_vfpv3 (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.arm.vfp");
+  tdesc_create_reg (feature, "d0", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d1", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d2", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d3", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d4", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d5", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d6", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d7", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d8", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d9", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d10", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d11", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d12", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d13", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d14", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d15", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d16", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d17", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d18", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d19", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d20", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d21", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d22", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d23", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d24", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d25", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d26", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d27", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d28", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d29", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d30", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "d31", regnum++, 1, NULL, 64, "ieee_double");
+  tdesc_create_reg (feature, "fpscr", regnum++, 1, "float", 32, "int");
+  return regnum;
+}
diff --git a/gdb/features/arm/xscale-iwmmxt.c b/gdb/features/arm/xscale-iwmmxt.c
new file mode 100644
index 0000000000..60dae40606
--- /dev/null
+++ b/gdb/features/arm/xscale-iwmmxt.c
@@ -0,0 +1,57 @@ 
+/* THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi:set ro:
+  Original: xscale-iwmmxt.xml */
+
+#include "common/tdesc.h"
+
+static int
+create_feature_arm_xscale_iwmmxt (struct target_desc *result, long regnum)
+{
+  struct tdesc_feature *feature;
+
+  feature = tdesc_create_feature (result, "org.gnu.gdb.xscale.iwmmxt");
+  tdesc_type *element_type;
+  element_type = tdesc_named_type (feature, "uint8");
+  tdesc_create_vector (feature, "iwmmxt_v8u8", element_type, 8);
+
+  element_type = tdesc_named_type (feature, "uint16");
+  tdesc_create_vector (feature, "iwmmxt_v4u16", element_type, 4);
+
+  element_type = tdesc_named_type (feature, "uint32");
+  tdesc_create_vector (feature, "iwmmxt_v2u32", element_type, 2);
+
+  tdesc_type_with_fields *type_with_fields;
+  type_with_fields = tdesc_create_union (feature, "iwmmxt_vec64i");
+  tdesc_type *field_type;
+  field_type = tdesc_named_type (feature, "iwmmxt_v8u8");
+  tdesc_add_field (type_with_fields, "u8", field_type);
+  field_type = tdesc_named_type (feature, "iwmmxt_v4u16");
+  tdesc_add_field (type_with_fields, "u16", field_type);
+  field_type = tdesc_named_type (feature, "iwmmxt_v2u32");
+  tdesc_add_field (type_with_fields, "u32", field_type);
+  field_type = tdesc_named_type (feature, "uint64");
+  tdesc_add_field (type_with_fields, "u64", field_type);
+
+  tdesc_create_reg (feature, "wR0", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR1", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR2", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR3", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR4", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR5", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR6", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR7", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR8", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR9", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR10", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR11", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR12", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR13", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR14", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wR15", regnum++, 1, NULL, 64, "iwmmxt_vec64i");
+  tdesc_create_reg (feature, "wCSSF", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCASF", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR0", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR1", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR2", regnum++, 1, "vector", 32, "int");
+  tdesc_create_reg (feature, "wCGR3", regnum++, 1, "vector", 32, "int");
+  return regnum;
+}
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index bd33091ba9..1c9d537745 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -1715,7 +1715,8 @@  maint_print_c_tdesc_cmd (const char *args, int from_tty)
       || startswith (filename_after_features.c_str (), "i386/x32-core.xml")
       || startswith (filename_after_features.c_str (), "riscv/")
       || startswith (filename_after_features.c_str (), "tic6x-")
-      || startswith (filename_after_features.c_str (), "aarch64"))
+      || startswith (filename_after_features.c_str (), "aarch64")
+      || startswith (filename_after_features.c_str (), "arm/"))
     {
       print_c_feature v (filename_after_features);