This is the mail archive of the gdb-cvs@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]

[binutils-gdb] Probe catch syscall support


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a31d2f068fa1384c505b540ea595d2d97813ba5f

commit a31d2f068fa1384c505b540ea595d2d97813ba5f
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Jun 28 12:02:35 2016 +0100

    Probe catch syscall support
    
    In 82075af2c14b1f8a54fa5796fb63f7ef23f98d9d (Implement 'catch syscall'
    for gdbserver), only x86 is supported, but the test can still be run
    on other linux targets, like aarch64 and ppc, with native-gdbserver.
    This causes many new fails.
    
    This patch removes the check on isnative and on target triplets.
    Instead, we can insert catch point, and resume the program to see whether
    catch syscall is supported or not.
    
    gdb/testsuite:
    
    2016-06-28  Yao Qi  <yao.qi@linaro.org>
    
    	* gdb.base/catch-syscall.exp: Remove check on isnative and target
    	triplets.  Start gdb, execute catch syscall, and continue.  Check
    	gdb's output to determine catch syscall is supported.

Diff:
---
 gdb/testsuite/ChangeLog                  |  6 +++++
 gdb/testsuite/gdb.base/catch-syscall.exp | 43 +++++++++++++++++++++-----------
 2 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b7e30f5..8ce6ee8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-28  Yao Qi  <yao.qi@linaro.org>
+
+	* gdb.base/catch-syscall.exp: Remove check on isnative and target
+	triplets.  Start gdb, execute catch syscall, and continue.  Check
+	gdb's output to determine catch syscall is supported.
+
 2016-06-27  Manish Goregaokar  <manish@mozilla.com>
 
 	* gdb.rust/simple.rs: Add test for returning unit in a function
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 5679000..f3ab6cb 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -19,20 +19,6 @@
 # It was written by Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
 # on September/2008.
 
-if { ![isnative] } then {
-    continue
-}
-
-# This shall be updated whenever 'catch syscall' is implemented
-# on some architecture.
-if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"]
-     && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"]
-     && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"]
-     && ![istarget "mips*-linux*"] && ![istarget "arm*-linux*"]
-     && ![istarget "s390*-linux*"] && ![istarget "aarch64*-*-linux*"] } {
-     continue
-}
-
 standard_testfile
 
 if  { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c] } {
@@ -40,6 +26,35 @@ if  { [prepare_for_testing ${testfile}.exp $testfile ${testfile}.c] } {
      return -1
 }
 
+# Check target supports catch syscall or not.
+clean_restart $binfile
+if ![runto_main] then {
+    fail "Can't run to main"
+    return
+}
+
+set test "catch syscall"
+gdb_test_multiple $test $test {
+    -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" {
+	unsupported "catch syscall isn't supported"
+	return -1
+    }
+    -re ".*$gdb_prompt $" {
+	pass $test
+    }
+}
+
+set test "check catch syscall"
+gdb_test_multiple "continue" $test {
+    -re ".*Your system does not support this type\r\nof catchpoint.*$gdb_prompt $" {
+	unsupported "catch syscall isn't supported"
+	return -1
+    }
+    -re ".*Catchpoint.*$gdb_prompt $" {
+      pass $test
+    }
+}
+
 # All (but the last) syscalls from the example code.  It is filled in
 # proc setup_all_syscalls.
 set all_syscalls { }


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