Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] New proc supports_get_siginfo_type
@ 2015-06-22 11:03 Yao Qi
  2015-06-22 11:03 ` [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type Yao Qi
  2015-06-24 10:32 ` [PATCH 1/2] New proc supports_get_siginfo_type Pedro Alves
  0 siblings, 2 replies; 7+ messages in thread
From: Yao Qi @ 2015-06-22 11:03 UTC (permalink / raw)
  To: gdb-patches

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-22  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/gdb.base/siginfo-obj.exp    |  4 +---
 gdb/testsuite/gdb.base/siginfo-thread.exp |  4 +---
 gdb/testsuite/lib/gdb.exp                 | 13 +++++++++++++
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.base/siginfo-obj.exp b/gdb/testsuite/gdb.base/siginfo-obj.exp
index 0d1b96d..578c12e 100644
--- a/gdb/testsuite/gdb.base/siginfo-obj.exp
+++ b/gdb/testsuite/gdb.base/siginfo-obj.exp
@@ -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
 }
diff --git a/gdb/testsuite/gdb.base/siginfo-thread.exp b/gdb/testsuite/gdb.base/siginfo-thread.exp
index 638bef3..a00b5aa 100644
--- a/gdb/testsuite/gdb.base/siginfo-thread.exp
+++ b/gdb/testsuite/gdb.base/siginfo-thread.exp
@@ -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
 }
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d169f3d..d3ed56f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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.
 
-- 
1.9.1


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

end of thread, other threads:[~2015-06-24 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22 11:03 [PATCH 1/2] New proc supports_get_siginfo_type Yao Qi
2015-06-22 11:03 ` [PATCH 2/2] Add aarch64-linux in supports_get_siginfo_type Yao Qi
2015-06-24 10:45   ` Pedro Alves
2015-06-24 13:31     ` Yao Qi
2015-06-24 13:39       ` Pedro Alves
2015-06-24 10:32 ` [PATCH 1/2] New proc supports_get_siginfo_type Pedro Alves
2015-06-24 13:57   ` Yao Qi

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