New proc supports_get_siginfo_type
authorYao Qi <yao.qi@linaro.org>
Wed, 24 Jun 2015 13:53:03 +0000 (14:53 +0100)
committerYao Qi <yao.qi@linaro.org>
Wed, 24 Jun 2015 13:53:03 +0000 (14:53 +0100)
Both siginfo-obj.exp and siginfo-thread.exp have the same code
checking the support of geting a type of siginfo for a given arch.
This patch is to move these code into a proc supports_get_siginfo_type.

gdb/testsuite:

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

* lib/gdb.exp (supports_get_siginfo_type): New proc.
* gdb.base/siginfo-obj.exp: Invoke supports_get_siginfo_type.
* gdb.base/siginfo-thread.exp: Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/siginfo-obj.exp
gdb/testsuite/gdb.base/siginfo-thread.exp
gdb/testsuite/lib/gdb.exp

index 3c8ecc01a476bec6f7c83b66d02632df08b7a9d6..c209fe6b4e52222a33cdf9ac1baf00eaacdfc332 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-24  Yao Qi  <yao.qi@linaro.org>
+
+       * lib/gdb.exp (supports_get_siginfo_type): New proc.
+       * gdb.base/siginfo-obj.exp: Invoke supports_get_siginfo_type.
+       * gdb.base/siginfo-thread.exp: Likewise.
+
 2015-06-22  Yao Qi  <yao.qi@linaro.org>
 
        * boards/remote-gdbserver-on-localhost.exp: Add comments.
index 0d1b96dc6fe5fc856352d27358a5bf3c66d9d327..578c12e3faf75280d82628f55e9e98f9ee956282 100644 (file)
@@ -26,9 +26,7 @@ if [target_info exists gdb,nosignals] {
     continue
 }
 
-if { ! [istarget "i?86-*-linux*"]
-     && ! [istarget "x86_64-*-linux*"]
-     && ! [istarget "arm*-*-linux*"] } {
+if { ![supports_get_siginfo_type] } {
     verbose "Skipping siginfo-obj.exp because of lack of support."
     return
 }
index 638bef3fb8b3d57ccb1bf03bb8edca51fab201f5..a00b5aadeb5e4b7e3a52fc287ec8359efb9ddeb7 100644 (file)
@@ -21,9 +21,7 @@ if [target_info exists gdb,nosignals] {
     continue
 }
 
-if { ! [istarget "i?86-*-linux*"]
-     && ! [istarget "x86_64-*-linux*"]
-     && ! [istarget "arm*-*-linux*"] } {
+if { ![supports_get_siginfo_type] } {
     verbose "Skipping siginfo-thread.exp because of lack of support."
     return
 }
index 9edf2dcd0d75cd1a9b1392d019f8e8e91f02213c..761f7d13c4832b9f6680caf993d721be268a5e7e 100644 (file)
@@ -1996,6 +1996,19 @@ gdb_caching_proc support_complex_tests {
     return $result
 }
 
+# Return 1 if GDB can get a type for siginfo from the target, otherwise
+# return 0.
+
+proc supports_get_siginfo_type {} {
+    if { [istarget "i?86-*-linux*"]
+        || [istarget "x86_64-*-linux*"]
+        || [istarget "arm*-*-linux*"] } {
+       return 1
+    } else {
+       return 0
+    }
+}
+
 # Return 1 if target hardware or OS supports single stepping to signal
 # handler, otherwise, return 0.
 
This page took 0.034705 seconds and 4 git commands to generate.