From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27466 invoked by alias); 14 Jun 2010 14:13:49 -0000 Received: (qmail 27452 invoked by uid 22791); 14 Jun 2010 14:13:46 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.17.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Jun 2010 14:13:33 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id o5EEDVB9017664 for ; Mon, 14 Jun 2010 14:13:31 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5EEDUkv1315024 for ; Mon, 14 Jun 2010 16:13:30 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o5EEDUsp013068 for ; Mon, 14 Jun 2010 16:13:30 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o5EEDTXT013028; Mon, 14 Jun 2010 16:13:29 +0200 Message-Id: <201006141413.o5EEDTXT013028@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 14 Jun 2010 16:13:29 +0200 Subject: [rfc] Handle lack of non-stop support more gracefully To: gdb-patches@sourceware.org Date: Mon, 14 Jun 2010 14:13:00 -0000 From: "Ulrich Weigand" Cc: pedro@codesourcery.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00308.txt.bz2 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