Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] testsuite: sigall.exp: handle SIGLOST/SIGPWR conflict in sparc64 targets
@ 2013-10-23 14:04 Jose E. Marchesi
  2013-12-03 11:58 ` Jose E. Marchesi
  0 siblings, 1 reply; 4+ messages in thread
From: Jose E. Marchesi @ 2013-10-23 14:04 UTC (permalink / raw)
  To: gdb-patches


Hi.

In sparc64 SIGLOST and SIGPWR have the same signal number.  The
following patch fixes gdb.base/sigall.exp accordingly.

Tested in sparc64-unknown-linux-gnu.

2013-10-23  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* gdb.base/sigall.exp (test_one_sig): gdb identifies SIGLOST as a
	SIGPWR in sparc64.

	* gdb.base/sigall.c (main): In some targets SIGLOST and SIGPWR
	have the same signal number.  Handle this situation.

diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
index 110029d..68f3ecb 100644
--- a/gdb/testsuite/gdb.base/sigall.c
+++ b/gdb/testsuite/gdb.base/sigall.c
@@ -1083,7 +1083,7 @@ return 0;
 int
 gen_PWR ()
 {
-#ifdef SIGPWR
+#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
   kill (getpid (), SIGPWR);
 #else
   handle_PWR (0);
@@ -1662,7 +1662,7 @@ main ()
 #ifdef SIGUSR2
   signal (SIGUSR2, handle_USR2);
 #endif
-#ifdef SIGPWR
+#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
   signal (SIGPWR, handle_PWR);
 #endif
 #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
index b1b8597..4bfb199 100644
--- a/gdb/testsuite/gdb.base/sigall.exp
+++ b/gdb/testsuite/gdb.base/sigall.exp
@@ -39,12 +39,20 @@ proc test_one_sig {nextsig} {
     set need_another_continue 1
     set missed_handler 0
     if $this_sig_supported then {
+	set esig $thissig
+
 	if { $thissig == "IO" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
+	# In SPARC64 systems SIGLOST==SIGPWR and gdb identifies the raised
+	# signal as PWR.
+	if { $thissig == "LOST" && [ istarget "sparc64-*-linux*" ] } then {
+	    set esig "PWR"
+	}
+
 	gdb_test "continue" \
-	    "Continuing.*Program received signal SIG$thissig.*" \
-	    "get signal $thissig"
+	    "Continuing.*Program received signal SIG$esig.*" \
+		"get signal $esig"
     }
     if [ istarget "alpha-dec-osf3*" ] then {
 	# OSF/1-3.x is unable to continue with a job control stop signal.


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

* Re: [PATCH] testsuite: sigall.exp: handle SIGLOST/SIGPWR conflict in sparc64 targets
  2013-10-23 14:04 [PATCH] testsuite: sigall.exp: handle SIGLOST/SIGPWR conflict in sparc64 targets Jose E. Marchesi
@ 2013-12-03 11:58 ` Jose E. Marchesi
  2013-12-03 12:07   ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: Jose E. Marchesi @ 2013-12-03 11:58 UTC (permalink / raw)
  To: gdb-patches


ping

    Hi.
    
    In sparc64 SIGLOST and SIGPWR have the same signal number.  The
    following patch fixes gdb.base/sigall.exp accordingly.
    
    Tested in sparc64-unknown-linux-gnu.
    
    2013-10-23  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* gdb.base/sigall.exp (test_one_sig): gdb identifies SIGLOST as a
    	SIGPWR in sparc64.
    
    	* gdb.base/sigall.c (main): In some targets SIGLOST and SIGPWR
    	have the same signal number.  Handle this situation.
    
    diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
    index 110029d..68f3ecb 100644
    --- a/gdb/testsuite/gdb.base/sigall.c
    +++ b/gdb/testsuite/gdb.base/sigall.c
    @@ -1083,7 +1083,7 @@ return 0;
     int
     gen_PWR ()
     {
    -#ifdef SIGPWR
    +#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
       kill (getpid (), SIGPWR);
     #else
       handle_PWR (0);
    @@ -1662,7 +1662,7 @@ main ()
     #ifdef SIGUSR2
       signal (SIGUSR2, handle_USR2);
     #endif
    -#ifdef SIGPWR
    +#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
       signal (SIGPWR, handle_PWR);
     #endif
     #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
    diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
    index b1b8597..4bfb199 100644
    --- a/gdb/testsuite/gdb.base/sigall.exp
    +++ b/gdb/testsuite/gdb.base/sigall.exp
    @@ -39,12 +39,20 @@ proc test_one_sig {nextsig} {
         set need_another_continue 1
         set missed_handler 0
         if $this_sig_supported then {
    +	set esig $thissig
    +
     	if { $thissig == "IO" } {
     	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
     	}
    +	# In SPARC64 systems SIGLOST==SIGPWR and gdb identifies the raised
    +	# signal as PWR.
    +	if { $thissig == "LOST" && [ istarget "sparc64-*-linux*" ] } then {
    +	    set esig "PWR"
    +	}
    +
     	gdb_test "continue" \
    -	    "Continuing.*Program received signal SIG$thissig.*" \
    -	    "get signal $thissig"
    +	    "Continuing.*Program received signal SIG$esig.*" \
    +		"get signal $esig"
         }
         if [ istarget "alpha-dec-osf3*" ] then {
     	# OSF/1-3.x is unable to continue with a job control stop signal.


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

* Re: [PATCH] testsuite: sigall.exp: handle SIGLOST/SIGPWR conflict in sparc64 targets
  2013-12-03 11:58 ` Jose E. Marchesi
@ 2013-12-03 12:07   ` Mark Kettenis
  2013-12-03 12:53     ` Jose E. Marchesi
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2013-12-03 12:07 UTC (permalink / raw)
  To: jose.marchesi; +Cc: gdb-patches

> From: jose.marchesi@oracle.com (Jose E. Marchesi)
> Date: Tue, 03 Dec 2013 12:59:02 +0100
> 
> ping
> 
>     Hi.
>     
>     In sparc64 SIGLOST and SIGPWR have the same signal number.  The
>     following patch fixes gdb.base/sigall.exp accordingly.
>     
>     Tested in sparc64-unknown-linux-gnu.
>     
>     2013-10-23  Jose E. Marchesi  <jose.marchesi@oracle.com>
>     
>     	* gdb.base/sigall.exp (test_one_sig): gdb identifies SIGLOST as a
>     	SIGPWR in sparc64.
>     
>     	* gdb.base/sigall.c (main): In some targets SIGLOST and SIGPWR
>     	have the same signal number.  Handle this situation.

Small nit:

>     diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
>     index b1b8597..4bfb199 100644
>     --- a/gdb/testsuite/gdb.base/sigall.exp
>     +++ b/gdb/testsuite/gdb.base/sigall.exp
>     @@ -39,12 +39,20 @@ proc test_one_sig {nextsig} {
>          set need_another_continue 1
>          set missed_handler 0
>          if $this_sig_supported then {
>     +	set esig $thissig
>     +
>      	if { $thissig == "IO" } {
>      	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
>      	}
>     +	# In SPARC64 systems SIGLOST==SIGPWR and gdb identifies the raised
>     +	# signal as PWR.

Change that into "On Linux SPARC64 systems..."

With that change, this is fine with me.


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

* Re: [PATCH] testsuite: sigall.exp: handle SIGLOST/SIGPWR conflict in sparc64 targets
  2013-12-03 12:07   ` Mark Kettenis
@ 2013-12-03 12:53     ` Jose E. Marchesi
  0 siblings, 0 replies; 4+ messages in thread
From: Jose E. Marchesi @ 2013-12-03 12:53 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches


    >     +	# In SPARC64 systems SIGLOST==SIGPWR and gdb identifies the raised
    >     +	# signal as PWR.
    
    Change that into "On Linux SPARC64 systems..."
    
    With that change, this is fine with me.

Ok.  Patch amended below and committed.
(By mistake I pushed a wrong date in the testsuite/ChangeLog entry and
had to fix that with a new commit.  Sorry about that!.)

2013-12-03  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* gdb.base/sigall.exp (test_one_sig): gdb identifies SIGLOST as a
	SIGPWR in sparc64.

	* gdb.base/sigall.c (main): In some targets SIGLOST and SIGPWR
	have the same signal number.  Handle this situation.

diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
index 110029d..68f3ecb 100644
--- a/gdb/testsuite/gdb.base/sigall.c
+++ b/gdb/testsuite/gdb.base/sigall.c
@@ -1083,7 +1083,7 @@ return 0;
 int
 gen_PWR ()
 {
-#ifdef SIGPWR
+#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
   kill (getpid (), SIGPWR);
 #else
   handle_PWR (0);
@@ -1662,7 +1662,7 @@ main ()
 #ifdef SIGUSR2
   signal (SIGUSR2, handle_USR2);
 #endif
-#ifdef SIGPWR
+#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
   signal (SIGPWR, handle_PWR);
 #endif
 #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
index b1b8597..d531479 100644
--- a/gdb/testsuite/gdb.base/sigall.exp
+++ b/gdb/testsuite/gdb.base/sigall.exp
@@ -39,12 +39,20 @@ proc test_one_sig {nextsig} {
     set need_another_continue 1
     set missed_handler 0
     if $this_sig_supported then {
+	set esig $thissig
+
 	if { $thissig == "IO" } {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
+	# On Linux SPARC64 systems SIGLOST==SIGPWR and gdb identifies
+	# the raised signal as PWR.
+	if { $thissig == "LOST" && [ istarget "sparc64-*-linux*" ] } then {
+	    set esig "PWR"
+	}
+
 	gdb_test "continue" \
-	    "Continuing.*Program received signal SIG$thissig.*" \
-	    "get signal $thissig"
+	    "Continuing.*Program received signal SIG$esig.*" \
+		"get signal $esig"
     }
     if [ istarget "alpha-dec-osf3*" ] then {
 	# OSF/1-3.x is unable to continue with a job control stop signal.


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

end of thread, other threads:[~2013-12-03 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 14:04 [PATCH] testsuite: sigall.exp: handle SIGLOST/SIGPWR conflict in sparc64 targets Jose E. Marchesi
2013-12-03 11:58 ` Jose E. Marchesi
2013-12-03 12:07   ` Mark Kettenis
2013-12-03 12:53     ` Jose E. Marchesi

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