From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26430 invoked by alias); 14 Jun 2010 15:50:07 -0000 Received: (qmail 26422 invoked by uid 22791); 14 Jun 2010 15:50:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.17.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Jun 2010 15:50:00 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.1/8.13.1) with ESMTP id o5EFnvnK010352 for ; Mon, 14 Jun 2010 15:49:57 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 o5EFnvgN1179714 for ; Mon, 14 Jun 2010 17:49:57 +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 o5EFnvtH029375 for ; Mon, 14 Jun 2010 17:49:57 +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 o5EFnuGE029348; Mon, 14 Jun 2010 17:49:56 +0200 Message-Id: <201006141549.o5EFnuGE029348@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 14 Jun 2010 17:49:56 +0200 Subject: Re: [rfc] Handle lack of non-stop support more gracefully To: pedro@codesourcery.com (Pedro Alves) Date: Mon, 14 Jun 2010 15:50:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <201006141600.45583.pedro@codesourcery.com> from "Pedro Alves" at Jun 14, 2010 04:00:45 PM 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/msg00310.txt.bz2 Pedro Alves wrote: > On Monday 14 June 2010 15:13:29, Ulrich Weigand wrote: > > Pedro, it seems you originally added the perror calls -- was there any > > reason I may be missing why we should need them anyway? > > Sorry, I don't recall. There was probably no good reason. I probably > copied it from what some CLI tests do: > > if ![runto_main] then { > perror "Couldn't run to main" > return -1 > } > > I've no objections to your patch. OK, thanks. I've checked the patch in now. > I took a quick look over mi-support, and I can see how I got a bit confused > about what do the different return codes leading up to mi_run_to_main mean. > It looks like some non-gdbserver targets will still trip on > this problem: > > } elseif { [target_info gdb_protocol] == "remote" } { > # remote targets > if { [mi_gdb_target_cmd "remote" [target_info netport]] != 0 } { > perror "Unable to connect to remote target" > return -1 > } > > ? > > Maybe mi_gdb_target_cmd should return a different error code for > not-supported vs connection error. > > I'm still a bit confused over how the non-stop MI handle this. If > mi_gdb_target_cmd fails to connect, it seems to return 0 anyway, so > the following tests will just cascade in FAILs. For other, non-remote > targets, mi_gdb_target_load will call perror on connection fail, but > the gdbserver branch at the top doesn't. I would suggest that just about any use of perror is wrong here. If the underlying library routine detects any condition that makes the rest of the test execution impossible, it should itself issue an appropriate test status, which would usually be FAIL (if the condition is due to a GDB bug), UNSUPPORTED (if it is due to some feature not available on the platform), or UNRESOLVED (if it is due to some setup or other external issue, like the target connection failing). Then, the library should return an error code that causes the main test case to silently stop any further test execution. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com