Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Handle lack of non-stop support more gracefully
@ 2010-06-14 14:13 Ulrich Weigand
  2010-06-14 15:01 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2010-06-14 14:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: pedro

Hello,

on spu-elf I'm now seeing:

ERROR: mi-ns-stale-regcache.exp tests suppressed
UNRESOLVED: gdb.mi/mi-nsintrall.exp: Couldn't compile /home/uweigand/fsf/gdb-head/gdb/testsuite/gdb.mi/nsintrall.c: unrecognized error

Now, on the SPU we don't support non-stop execution (in fact, the SPU
is always single-threaded anyway).  Therefore, all the non-stop tests
ought to be marked as UNSUPPORTED.  And in fact, the mi_run_to_main
routine does that.

However, various test cases, *in addition* to the actions done by
the mi_run_to_main routine, themselves call "perror":
    perror "mi-ns-stale-regcache.exp tests suppressed"

This seems wrong to me: First of all, an ERROR is supposed to mark some
sort of unexpected failure of the test harness itself, with unpredictable
results on the test outcome.  This is not the case for a feature that is
simply not supported on a target.  Second, because of that, the DejaGNU
main test harness will use the presence of any perror call as signal to
mark the next regular test result as UNRESOLVED instead of whatever the
actual result was -- even if this happens to be in a completely different
test!  (See the example above.)

[ Note that the reason this doesn't show up with any of the other non-stop
tests on SPU is that they already fail during the compile stage due to
the absence of pthreads support.  mi-ns-stale-regcache is the only non-stop
test that does not require pthreads.  ]

It seems to me the correct way to handle this is for mi_run_to_main to
detect the case where the non-stop feature is unsupported, generate an
appropriate test result (UNSUPPORTED), which it already does, and then
have the main test just terminate with no further message.

The following patch implements this, and fixes the above problems on SPU.

Pedro, it seems you originally added the perror calls -- was there any
reason I may be missing why we should need them anyway?

Bye,
Ulrich

ChangeLog:

	* gdb.mi/mi-nonstop.exp: Do not call perror if non-stop mode is
	not supported on the target.
	* gdb.mi/mi-nonstop-exit.exp: Likewise.
	* gdb.mi/mi-ns-stale-regcache.exp: Likewise.
	* gdb.mi/mi-nsintrall.exp: Likewise.
	* gdb.mi/mi-nsmoribund.exp: Likewise.
	* gdb.mi/mi-nsthrexec.exp: Likewise.

Index: gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi-nonstop-exit.exp
--- gdb/testsuite/gdb.mi/mi-nonstop-exit.exp	26 May 2010 18:12:13 -0000	1.4
+++ gdb/testsuite/gdb.mi/mi-nonstop-exit.exp	13 Jun 2010 17:00:16 -0000
@@ -52,7 +52,6 @@ mi_gdb_test "-gdb-set target-async 1" ".
 detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-nonstop-exit.exp tests suppressed"
     continue
 }
 
@@ -63,7 +62,6 @@ mi_expect_stop "exited-normally" "" "" "
 # Run the program again.
 
 if { [mi_run_to_main] < 0 } {
-    fail "run (2)"
     continue
 }
 
Index: gdb/testsuite/gdb.mi/mi-nonstop.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nonstop.exp,v
retrieving revision 1.12
diff -u -p -r1.12 mi-nonstop.exp
--- gdb/testsuite/gdb.mi/mi-nonstop.exp	26 May 2010 18:12:13 -0000	1.12
+++ gdb/testsuite/gdb.mi/mi-nonstop.exp	13 Jun 2010 17:00:16 -0000
@@ -62,7 +62,6 @@ mi_gdb_test "-gdb-set target-async 1" ".
 detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-nonstop.exp tests suppressed"
     continue
 }
 
Index: gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp,v
retrieving revision 1.2
diff -u -p -r1.2 mi-ns-stale-regcache.exp
--- gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp	26 May 2010 18:12:13 -0000	1.2
+++ gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp	13 Jun 2010 17:00:16 -0000
@@ -66,7 +66,6 @@ mi_gdb_test "-gdb-set target-async 1" ".
 detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-ns-stale-regcache.exp tests suppressed"
     continue
 }
 
Index: gdb/testsuite/gdb.mi/mi-nsintrall.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsintrall.exp,v
retrieving revision 1.7
diff -u -p -r1.7 mi-nsintrall.exp
--- gdb/testsuite/gdb.mi/mi-nsintrall.exp	1 Jun 2010 17:22:33 -0000	1.7
+++ gdb/testsuite/gdb.mi/mi-nsintrall.exp	13 Jun 2010 17:00:16 -0000
@@ -52,7 +52,6 @@ mi_gdb_test "-gdb-set target-async 1" ".
 detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-nsintrall.exp tests suppressed"
     continue
 }
 
Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi-nsmoribund.exp
--- gdb/testsuite/gdb.mi/mi-nsmoribund.exp	26 May 2010 18:12:13 -0000	1.6
+++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp	13 Jun 2010 17:00:16 -0000
@@ -52,7 +52,6 @@ mi_gdb_test "-gdb-set target-async 1" ".
 detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-nsmoribund.exp tests suppressed"
     continue
 }
 
Index: gdb/testsuite/gdb.mi/mi-nsthrexec.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsthrexec.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi-nsthrexec.exp
--- gdb/testsuite/gdb.mi/mi-nsthrexec.exp	26 May 2010 18:12:13 -0000	1.3
+++ gdb/testsuite/gdb.mi/mi-nsthrexec.exp	13 Jun 2010 17:00:16 -0000
@@ -62,7 +62,6 @@ mi_gdb_test "-gdb-set target-async 1" ".
 detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-nsthrexec.exp tests suppressed"
     continue
 }
 
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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

end of thread, other threads:[~2010-06-14 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-14 14:13 [rfc] Handle lack of non-stop support more gracefully Ulrich Weigand
2010-06-14 15:01 ` Pedro Alves
2010-06-14 15:50   ` Ulrich Weigand
2010-06-14 15:59     ` Pedro Alves

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