Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 04/11] Set architecture to arm in arm-*.xml files
Date: Wed, 01 Jul 2015 13:58:00 -0000	[thread overview]
Message-ID: <1435759111-22856-5-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1435759111-22856-1-git-send-email-yao.qi@linaro.org>

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-06-29  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.
---
 gdb/features/arm-with-m-fpa-layout.c   | 2 ++
 gdb/features/arm-with-m-fpa-layout.xml | 1 +
 gdb/features/arm-with-m-vfp-d16.c      | 2 ++
 gdb/features/arm-with-m-vfp-d16.xml    | 1 +
 gdb/features/arm-with-m.c              | 2 ++
 gdb/features/arm-with-m.xml            | 1 +
 gdb/features/arm-with-neon.c           | 2 ++
 gdb/features/arm-with-neon.xml         | 1 +
 gdb/features/arm-with-vfpv2.c          | 2 ++
 gdb/features/arm-with-vfpv2.xml        | 1 +
 gdb/features/arm-with-vfpv3.c          | 2 ++
 gdb/features/arm-with-vfpv3.xml        | 1 +
 12 files changed, 18 insertions(+)

diff --git a/gdb/features/arm-with-m-fpa-layout.c b/gdb/features/arm-with-m-fpa-layout.c
index bc51f05..f720614 100644
--- a/gdb/features/arm-with-m-fpa-layout.c
+++ b/gdb/features/arm-with-m-fpa-layout.c
@@ -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");
diff --git a/gdb/features/arm-with-m-fpa-layout.xml b/gdb/features/arm-with-m-fpa-layout.xml
index 7700666..aab1806 100644
--- a/gdb/features/arm-with-m-fpa-layout.xml
+++ b/gdb/features/arm-with-m-fpa-layout.xml
@@ -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"/>
diff --git a/gdb/features/arm-with-m-vfp-d16.c b/gdb/features/arm-with-m-vfp-d16.c
index a0da583..069baac 100644
--- a/gdb/features/arm-with-m-vfp-d16.c
+++ b/gdb/features/arm-with-m-vfp-d16.c
@@ -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");
diff --git a/gdb/features/arm-with-m-vfp-d16.xml b/gdb/features/arm-with-m-vfp-d16.xml
index 315d1a8..0586017 100644
--- a/gdb/features/arm-with-m-vfp-d16.xml
+++ b/gdb/features/arm-with-m-vfp-d16.xml
@@ -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"/>
diff --git a/gdb/features/arm-with-m.c b/gdb/features/arm-with-m.c
index 8e27a80..64d31bb 100644
--- a/gdb/features/arm-with-m.c
+++ b/gdb/features/arm-with-m.c
@@ -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");
diff --git a/gdb/features/arm-with-m.xml b/gdb/features/arm-with-m.xml
index 6289472..a7aa2d2 100644
--- a/gdb/features/arm-with-m.xml
+++ b/gdb/features/arm-with-m.xml
@@ -7,5 +7,6 @@
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
 <target>
+  <architecture>arm</architecture>
   <xi:include href="arm-m-profile.xml"/>
 </target>
diff --git a/gdb/features/arm-with-neon.c b/gdb/features/arm-with-neon.c
index 61c9a3a..d365c0f 100644
--- a/gdb/features/arm-with-neon.c
+++ b/gdb/features/arm-with-neon.c
@@ -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");
diff --git a/gdb/features/arm-with-neon.xml b/gdb/features/arm-with-neon.xml
index b537337..777b826 100644
--- a/gdb/features/arm-with-neon.xml
+++ b/gdb/features/arm-with-neon.xml
@@ -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"/>
diff --git a/gdb/features/arm-with-vfpv2.c b/gdb/features/arm-with-vfpv2.c
index 78e3c81..0ebbfef 100644
--- a/gdb/features/arm-with-vfpv2.c
+++ b/gdb/features/arm-with-vfpv2.c
@@ -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");
diff --git a/gdb/features/arm-with-vfpv2.xml b/gdb/features/arm-with-vfpv2.xml
index 6008124..fe7941a 100644
--- a/gdb/features/arm-with-vfpv2.xml
+++ b/gdb/features/arm-with-vfpv2.xml
@@ -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>
diff --git a/gdb/features/arm-with-vfpv3.c b/gdb/features/arm-with-vfpv3.c
index e48ca79..e235dfa 100644
--- a/gdb/features/arm-with-vfpv3.c
+++ b/gdb/features/arm-with-vfpv3.c
@@ -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");
diff --git a/gdb/features/arm-with-vfpv3.xml b/gdb/features/arm-with-vfpv3.xml
index e4eeb6a..66d98ec 100644
--- a/gdb/features/arm-with-vfpv3.xml
+++ b/gdb/features/arm-with-vfpv3.xml
@@ -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>
-- 
1.9.1


  parent reply	other threads:[~2015-07-01 13:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 13:58 [PATCH 00/11] Aarch64 linux GDB native multi-arch debugging (part 1) Yao Qi
2015-07-01 13:58 ` [PATCH 07/11] New proc is_aarch32_target Yao Qi
2015-07-01 13:58 ` Yao Qi [this message]
2015-07-01 13:58 ` [PATCH 08/11] New proc is_aarch64_target Yao Qi
2015-07-01 14:10   ` Andreas Schwab
2015-07-01 14:19     ` Yao Qi
2015-07-01 14:39       ` Andreas Schwab
2015-07-01 13:58 ` [PATCH 01/11] Remove {fetch,store}_fpregister and {fetch,store}_register Yao Qi
2015-07-01 13:58 ` [PATCH 02/11] New aarch32-linux-nat.c Yao Qi
2015-07-01 13:59 ` [PATCH 10/11] Reply s and S vCont actions if target supports hardware single step Yao Qi
2015-07-01 13:59 ` [PATCH 03/11] Native debug arm program by aarch64 GDB Yao Qi
2015-07-01 13:59 ` [PATCH 09/11] [gdbserver] Rename supports_conditional_breakpoints to supports_hardware_single_step Yao Qi
2015-07-01 13:59 ` [PATCH 05/11] Adjust gdb.multi tests for aarch64 Yao Qi
2015-07-01 13:59 ` [PATCH 06/11] Enable multi-arch test in catch-syscall.exp on aarch64 Yao Qi
2015-07-01 13:59 ` [PATCH 11/11] New target_ops hook to_can_do_single_step Yao Qi
2015-07-01 16:43   ` Pedro Alves
2015-07-02  8:56     ` Yao Qi
2015-07-02  9:09       ` Pedro Alves
2015-07-01 17:00 ` [PATCH 00/11] Aarch64 linux GDB native multi-arch debugging (part 1) Pedro Alves
2015-07-01 18:54   ` Pedro Alves
2015-07-02  9:05   ` Yao Qi
2015-07-07 16:13   ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435759111-22856-5-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox