Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Run gdb.compile/*.exp on {x86,x86_64,s390}-linux only
@ 2018-01-16 11:50 Yao Qi
  2018-01-16 12:18 ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: Yao Qi @ 2018-01-16 11:50 UTC (permalink / raw)
  To: gdb-patches; +Cc: jan.kratochvil, pmuldoon

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-01-17 10:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16 11:50 [PATCH] Run gdb.compile/*.exp on {x86,x86_64,s390}-linux only Yao Qi
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox