This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Run gdb.compile/*.exp on {x86,x86_64,s390}-linux only


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]