public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 05/11] Adjust gdb.multi tests for aarch64
Date: Wed, 01 Jul 2015 13:59:00 -0000	[thread overview]
Message-ID: <1435759111-22856-6-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1435759111-22856-1-git-send-email-yao.qi@linaro.org>

Multi-arch related tests under gdb.multi are to compile programs with
the same compiler but different compiler options (-m64 vs -m32).  However,
different compilers are needed to compile both aarch64 program and
arm (aarch32) program.  This patch is to adjust these test cases to
compile programs in different modes with different compiler.

When we use gcc for arm-linux target, its file name can be different,
arm-linux-gnueabihf-gcc, arm-linux-gnueabi-gcc, or arm-none-linux-gnueabi-gcc,
so I add a variable ARM_CC_FOR_TARGET, so that user can set the name
of gcc for arm-linux target on aarch64, like:

 $ make check RUNTESTFLAGS='ARM_CC_FOR_TARGET=arm-linux-gnueabihf-gcc multi-arch.exp'

gdb/testsuite:

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

	* gdb.multi/multi-arch-exec.exp: Set march1 and march2 to "" if target
	is aarch64.  If target is aarch64, set compiler=${ARM_CC_FOR_TARGET}
	if it exists.
	* gdb.multi/multi-arch.exp: Likewise.
---
 gdb/testsuite/gdb.multi/multi-arch-exec.exp | 18 +++++++++++++++++-
 gdb/testsuite/gdb.multi/multi-arch.exp      | 18 +++++++++++++++++-
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index 4532108..67020d9 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -44,6 +44,9 @@ set binfile2 [standard_output_file ${exec2}]
 if [istarget "s390*-*-*"] {
     set march1 "-m64"
     set march2 "-m31"
+} elseif { [istarget "aarch64*-*-*"] } {
+    set march1 ""
+    set march2 ""
 } else {
     set march1 "-m64"
     set march2 "-m32"
@@ -57,8 +60,21 @@ if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
     return -1
 }
 
+set options [list debug nowarnings]
+
+if { [istarget "aarch64*-*-*"] } {
+    if {[info exists ARM_CC_FOR_TARGET]} {
+	lappend options "compiler=${ARM_CC_FOR_TARGET}"
+    } else {
+	unsupported "ARM compiler is not known"
+	return -1
+    }
+} else {
+    lappend options "additional_flags=${march2}"
+}
+
 if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" \
-	  [list debug nowarnings additional_flags=${march2}]] } {
+	  $options] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index 22ad4da..4b255ee 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -44,6 +44,9 @@ set binfile2 [standard_output_file ${exec2}]
 if [istarget "s390*-*-*"] {
     set march1 "-m64"
     set march2 "-m31"
+} elseif { [istarget "aarch64*-*-*"] } {
+    set march1 ""
+    set march2 ""
 } else {
     set march1 "-m64"
     set march2 "-m32"
@@ -54,8 +57,21 @@ if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
     return -1
 }
 
+set options [list debug nowarnings]
+
+if [istarget "aarch64*-*-*"] {
+    if {[info exists ARM_CC_FOR_TARGET]} {
+	lappend options "compiler=${ARM_CC_FOR_TARGET}"
+    } else {
+	unsupported "ARM compiler is not known"
+	return -1
+    }
+} else {
+    lappend options "additional_flags=${march2}"
+}
+
 if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" \
-	  [list debug nowarnings additional_flags=${march2}]] } {
+	 $options]} {
     return -1
 }
 
-- 
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 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 07/11] New proc is_aarch32_target Yao Qi
2015-07-01 13:58 ` [PATCH 02/11] New aarch32-linux-nat.c Yao Qi
2015-07-01 13:58 ` [PATCH 04/11] Set architecture to arm in arm-*.xml files Yao Qi
2015-07-01 13:58 ` [PATCH 01/11] Remove {fetch,store}_fpregister and {fetch,store}_register 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 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 10/11] Reply s and S vCont actions if target supports hardware single step Yao Qi
2015-07-01 13:59 ` Yao Qi [this message]
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-6-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).