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

[rfc] Handle lack of non-stop support more gracefully


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


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