From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12785 invoked by alias); 11 Apr 2012 15:25:59 -0000 Received: (qmail 12767 invoked by uid 22791); 11 Apr 2012 15:25:57 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Apr 2012 15:25:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 054231C6888; Wed, 11 Apr 2012 11:25:39 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vSHQMN854FRP; Wed, 11 Apr 2012 11:25:38 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BF33E1C6873; Wed, 11 Apr 2012 11:25:38 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id EF588145616; Wed, 11 Apr 2012 08:25:31 -0700 (PDT) Date: Wed, 11 Apr 2012 15:35:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] More suggestive error_is_running message Message-ID: <20120411152531.GD2852@adacore.com> References: <20120410191907.GA31331@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120410191907.GA31331@host2.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2012-04/txt/msg00250.txt.bz2 > gdb/ > 2012-04-10 Jan Kratochvil > > Provide more specific error_is_running error message. > * infrun.c (error_is_running): Extend the error message text. > > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -3038,7 +3045,9 @@ void > error_is_running (void) > { > error (_("Cannot execute this command while " > - "the selected thread is running.")); > + "the selected thread is running. " > + "(You may want to use 'interrupt' " > + "and wait for '[Thread N] #1 stopped.'.)")); > } Just my two cents on this, I don't really have a strong opinion. I'd put the new output on a second line, and also avoid duplicating the actual notification. That way, if we change its format, it doesn't become inconsistent. There's also the case of being in GDB/MI mode, as well as the case where the ptid is displayed differently on non-Linux platforms. Similarly, I think we want to avoid the "interrupt" command name, because I suspect that many users will be using a graphical frontend and that's not going to be very helpful to them. Trying to come up with a concise error message, I couldn't really find something all that great. I think that it's OK to drop the part that talks about waiting for the stop notification. Once you've used it once, you'll know, and for the first time, even if you are fast enough to send the interrupt and emit the command again before the thread stopped, you'll get the same message, followed by the stop notification. That should be enough to understand that you had to wait? So how about: Cannot execute this command while the selected thread is running. You need to interrupt this thread's execution first. ? -- Joel