Set architecture to arm in arm-*.xml files
authorYao Qi <yao.qi@linaro.org>
Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)
committerYao Qi <yao.qi@linaro.org>
Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)
This patch is to add the following line to various arm target description
xml files,

<architecture>arm</architecture>

in order to fix problems I've seen on aarch64 multi-arch debugging,

 detach^M
 Detaching from program: build-gdb/gdb/testsuite/gdb.base/attach, process 17145^M
 (gdb) PASS: gdb.base/attach.exp: attach1 detach file^M
 No executable file now.^M
 Architecture of file not recognized.^M
 (gdb) FAIL: gdb.base/attach.exp: attach1, purging symbols after detach

Without this patch, struct target_desc *tdesc_* are not initialised
properly, that is, fields arch and osabi in 'struct target_desc' are
not set properly.  This doesn't cause any problems on single arch
debugging, because arch-utils.c:gdbarch_info_fill will guess correctly.
However, in multi-arch debugging, gdbarch_info_fill gets the aarch64
arch, but the target description is for arm (because the current
inferior is 32-bit arm).

It is a surprise to me we didn't set architecture to "arm" before in *.xml
files, and I didn't find out why didn't do so.  AFAICS,
gdb/features/arm-with-iwmmxt.xml was added firstly (in patch
https://sourceware.org/ml/gdb-patches/2007-01/msg00593.html)
which had <architecture>iwmmxt</architecture>, however, afterwards,
architecture isn't set anymore in features/arm-*.xml files (in patches
https://sourceware.org/ml/gdb-patches/2009-07/msg00689.html and
https://sourceware.org/ml/gdb-patches/2010-08/msg00225.html).

gdb:

2015-07-07  Yao Qi  <yao.qi@linaro.org>

* features/arm-with-m-fpa-layout.xml: Set architecture to arm.
* features/arm-with-m-fpa-layout.c: Regenerated.
* features/arm-with-m-vfp-d16.xml: Likewise.
* features/arm-with-m-vfp-d16.c: Regenerated.
* features/arm-with-m.xml: Likewise.
* features/arm-with-m.c: Regenerated.
* features/arm-with-neon.xml: Likewise.
* features/arm-with-neon.c: Regenerated.
* features/arm-with-vfpv2.xml: Likewise.
* features/arm-with-vfpv2.c: Regenerated.
* features/arm-with-vfpv3.xml: Likewise.
* features/arm-with-vfpv3.c: Regenerated.

13 files changed:
gdb/ChangeLog
gdb/features/arm-with-m-fpa-layout.c
gdb/features/arm-with-m-fpa-layout.xml
gdb/features/arm-with-m-vfp-d16.c
gdb/features/arm-with-m-vfp-d16.xml
gdb/features/arm-with-m.c
gdb/features/arm-with-m.xml
gdb/features/arm-with-neon.c
gdb/features/arm-with-neon.xml
gdb/features/arm-with-vfpv2.c
gdb/features/arm-with-vfpv2.xml
gdb/features/arm-with-vfpv3.c
gdb/features/arm-with-vfpv3.xml

index c1f3994664e2e62cf5eb79d7f6a9d34502914d35..680f96c6e8e2410c826517acffbd980d5a0af6e0 100644 (file)
@@ -1,3 +1,18 @@
+2015-07-07  Yao Qi  <yao.qi@linaro.org>
+
+       * features/arm-with-m-fpa-layout.xml: Set architecture to arm.
+       * features/arm-with-m-fpa-layout.c: Regenerated.
+       * features/arm-with-m-vfp-d16.xml: Likewise.
+       * features/arm-with-m-vfp-d16.c: Regenerated.
+       * features/arm-with-m.xml: Likewise.
+       * features/arm-with-m.c: Regenerated.
+       * features/arm-with-neon.xml: Likewise.
+       * features/arm-with-neon.c: Regenerated.
+       * features/arm-with-vfpv2.xml: Likewise.
+       * features/arm-with-vfpv2.c: Regenerated.
+       * features/arm-with-vfpv3.xml: Likewise.
+       * features/arm-with-vfpv3.c: Regenerated.
+
 2015-07-07  Yao Qi  <yao.qi@linaro.org>
 
        * aarch32-linux-nat.h (VFP_REGS_SIZE): New macro, moved from
index bc51f052118c689133ddd004e2276079fc4ef911..f720614959ca91dcedd34c140ba2f4eeabb05ae6 100644 (file)
@@ -12,6 +12,8 @@ initialize_tdesc_arm_with_m_fpa_layout (void)
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
 
+  set_tdesc_architecture (result, bfd_scan_arch ("arm"));
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
index 77006660897a8cb81fcd0adcd41565908395a18f..aab180673f78a6f0a4170237c35b358deeb2c992 100644 (file)
@@ -10,6 +10,7 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+<architecture>arm</architecture>
 <feature name="org.gnu.gdb.arm.m-profile">
   <reg name="r0" bitsize="32"/>
   <reg name="r1" bitsize="32"/>
index a0da583f43896666283007d513b14ebdd803e928..069baac4db846e27964b56437b247b407ba0facc 100644 (file)
@@ -12,6 +12,8 @@ initialize_tdesc_arm_with_m_vfp_d16 (void)
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
 
+  set_tdesc_architecture (result, bfd_scan_arch ("arm"));
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
index 315d1a8d33ae512b12d791f9b12c3371175ffe83..0586017ef586449bc109f535ae0277e1a7c144e1 100644 (file)
@@ -7,6 +7,7 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+  <architecture>arm</architecture>
   <xi:include href="arm-m-profile.xml"/>
   <!-- Layout of vfpv4-sp-d16 is identical to vfpv2 -->
   <xi:include href="arm-vfpv2.xml"/>
index 8e27a80789f6c51c1e5d13090d9ef521e258b64f..64d31bb9c6f85dcdac104c846c8b191e809f7b7f 100644 (file)
@@ -12,6 +12,8 @@ initialize_tdesc_arm_with_m (void)
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
 
+  set_tdesc_architecture (result, bfd_scan_arch ("arm"));
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-profile");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "int");
   tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "int");
index 6289472c30124da40c128aadaa5a0e3832236c0b..a7aa2d2c3f76fd013bcf27fbdc3bb998761d3c64 100644 (file)
@@ -7,5 +7,6 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+  <architecture>arm</architecture>
   <xi:include href="arm-m-profile.xml"/>
 </target>
index 61c9a3a360196cd8dc989e584464a53676ee8ae9..d365c0fd3ae09dcaa9877d6beea30186720144be 100644 (file)
@@ -12,6 +12,8 @@ initialize_tdesc_arm_with_neon (void)
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
 
+  set_tdesc_architecture (result, bfd_scan_arch ("arm"));
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
   tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
index b5373374d061b9ecc207bbfd568d1d87bf2afc59..777b8260b9c2d45390ec16e6f4e9f38a62b36465 100644 (file)
@@ -7,6 +7,7 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+  <architecture>arm</architecture>
   <xi:include href="arm-core.xml"/>
   <xi:include href="arm-vfpv3.xml"/>
   <feature name="org.gnu.gdb.arm.neon"/>
index 78e3c81920c1361ef763af2415bc2ee3dcfce87d..0ebbfef6e2accca03901adc4cc49857c48de9eab 100644 (file)
@@ -12,6 +12,8 @@ initialize_tdesc_arm_with_vfpv2 (void)
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
 
+  set_tdesc_architecture (result, bfd_scan_arch ("arm"));
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
   tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
index 6008124f02afc8aee324437c8e4692d8c0011f5b..fe7941ad272f7b6f0bbfd8466ae93c54b825a6c3 100644 (file)
@@ -7,6 +7,7 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+  <architecture>arm</architecture>
   <xi:include href="arm-core.xml"/>
   <xi:include href="arm-vfpv2.xml"/>
 </target>
index e48ca795700d3cd0659b0dfc975c976fa7c7ae64..e235dfa762684e874cf44aa2f61ac33c4f4f4384 100644 (file)
@@ -12,6 +12,8 @@ initialize_tdesc_arm_with_vfpv3 (void)
   struct target_desc *result = allocate_target_description ();
   struct tdesc_feature *feature;
 
+  set_tdesc_architecture (result, bfd_scan_arch ("arm"));
+
   feature = tdesc_create_feature (result, "org.gnu.gdb.arm.core");
   tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
   tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
index e4eeb6aaf80b48940722bb05f49c86d991b99e6b..66d98ecded02ec118b232fbb13e4bc70ade64860 100644 (file)
@@ -7,6 +7,7 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+  <architecture>arm</architecture>
   <xi:include href="arm-core.xml"/>
   <xi:include href="arm-vfpv3.xml"/>
 </target>