From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Cc: jan.kratochvil@redhat.com, pmuldoon@redhat.com
Subject: [PATCH] Run gdb.compile/*.exp on {x86,x86_64,s390}-linux only
Date: Tue, 16 Jan 2018 11:50:00 -0000 [thread overview]
Message-ID: <1516103412-25086-1-git-send-email-yao.qi@linaro.org> (raw)
I see many gdb.compile/*.exp fails on aarch64-linux and arm-linux,
(gdb) compile code -- ;
Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$"
(gdb) compile code -- ;
aarch64-none-linux-gnu-gcc: error: unrecognized command line option '-m64'
I think we need to properly skip tests on targets which don't support
compile. As far as I know, gdb compile is supported on x86, x86_64,
and s390.
This patch matches the target triplet in
lib/gdb.exp:skip_compile_feature_tests. If the target triplet is
*not* x86,x86_64, and s390 linux, return 1; otherwise, do the
"compile code -- ;" test.
An alternative approach is to modify lib/gdb.exp:skip_compile_feature_tests
to match these error messages above. However, these error message is
from libcc1, subject to change, and other targets may have different
error messages from libcc1.
gdb/testsuite:
2018-01-16 Yao Qi <yao.qi@linaro.org>
* lib/gdb.exp (skip_compile_feature_tests): Return 1 if target
triplet isn't x86-linux or s390-linux.
---
gdb/testsuite/lib/gdb.exp | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index a4bde72..8723925 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3141,16 +3141,25 @@ proc skip_compile_feature_tests {} {
global gdb_prompt
set result 0
- gdb_test_multiple "compile code -- ;" "check for working compile command" {
- "Could not load libcc1.*\r\n$gdb_prompt $" {
- set result 1
- }
- -re "Command not supported on this host\\..*\r\n$gdb_prompt $" {
- set result 1
- }
- -re "\r\n$gdb_prompt $" {
+
+ if { [istarget "i\[34567\]86-*-linux*"]
+ || [istarget "x86_64-*-linux*"]
+ || [istarget "s390*-*-linux*"] } {
+ gdb_test_multiple "compile code -- ;" \
+ "check for working compile command" {
+ "Could not load libcc1.*\r\n$gdb_prompt $" {
+ set result 1
+ }
+ -re "Command not supported on this host\\..*\r\n$gdb_prompt $" {
+ set result 1
+ }
+ -re "\r\n$gdb_prompt $" {
+ }
}
+ } else {
+ set result 1
}
+
return $result
}
--
1.9.1
next reply other threads:[~2018-01-16 11:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-16 11:50 Yao Qi [this message]
2018-01-16 12:18 ` Pedro Alves
2018-01-16 15:14 ` Yao Qi
2018-01-16 16:47 ` Phil Muldoon
2018-01-16 16:59 ` Pedro Alves
2018-01-16 17:20 ` Pedro Alves
2018-01-16 17:45 ` Yao Qi
2018-01-16 18:58 ` Sergio Durigan Junior
2018-01-17 10:06 ` 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=1516103412-25086-1-git-send-email-yao.qi@linaro.org \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=pmuldoon@redhat.com \
/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