From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12107 invoked by alias); 29 Jun 2008 06:05:35 -0000 Received: (qmail 12098 invoked by uid 22791); 29 Jun 2008 06:05:34 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 29 Jun 2008 06:05:12 +0000 Received: (qmail 18548 invoked from network); 29 Jun 2008 06:05:11 -0000 Received: from unknown (HELO wind.local) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Jun 2008 06:05:11 -0000 From: Vladimir Prus To: Eli Zaretskii Subject: Re: [MI non-stop 04/11] Implement --thread and --frame. Date: Sun, 29 Jun 2008 06:10:00 -0000 User-Agent: KMail/1.9.9 Cc: gdb-patches@sources.redhat.com References: <200806282044.14246.vladimir@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200806291005.14181.vladimir@codesourcery.com> 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: 2008-06/txt/msg00575.txt.bz2 On Saturday 28 June 2008 22:16:06 Eli Zaretskii wrote: > > From: Vladimir Prus > > Date: Sat, 28 Jun 2008 21:34:57 +0400 > > > > Eli Zaretskii wrote: > > > > >> From: Vladimir Prus > > >> Date: Sat, 28 Jun 2008 20:44:14 +0400 > > >> > > >> > > >> + if (parse->frame != -1 && !parse->thread == -1) > > >> + error ("Cannot specify --frame without --thread"); > > > > > > Why is this error message not in _(), while all the rest are? > > > > > > Btw, do we at all want error messages issued by MI commands > > > translated? > > > > I think we don't, but I'm not sure. > > > > > > > MI commands are invoked by a program, so error messages > > > we generate should be understandable by a program, which probably > > > means they should not be translated. > > > > It's a bit questionable. For example, the error you mention above > > is clearly a bug in frontend. Presenting a translated version of > > that message to the user is essentially pointless. On the other > > hand, "Thread is running", or "Memory not accessible" messages > > can be helpful for users. Do we need two error messages, maybe? > > Maybe. Do front ends show the error messages to the user, or do they > act on them themselves (or both)? Both, I think. I'd expect that right now, showing the message to the user is more common than handling it internally -- because it's fairly hard to guess, from an error message, what is this. For example, KDevelop 3.5, when operating with pre-6.8 gdb, will handle all errors from -break-insert command -- assuming we get an error because the location is in not-yet-loaded shared library. But, this has the potential to hide real error -- like line number that is out of range. It seems like the only solution is to have some set of error codes, which are never shown to the user, and then have the message string i18ned. > > >> + if (strncmp (chp, "--thread", 8) == 0) > > > > > > Please, let's not use literal constants in this context, let's use > > > sizeof instead. > > > > sizeof? For all I know, sizeof("--thread") will be wrong here. > > Why would it be wrong? It will give you 9, here. > > >> + parse->frame = strtol (chp, &chp, 10); > > > > > > Do we really want to disallow non-decimal numbers here? What about > > > hex frame numbers? > > > > Why would frontend want to specify frame level in hex? > > I dunno, does the MI spec mandate decimal here? If it does, then my > comment is hereby withdrawn. The spec does not mandate decimal, or allow hex -- yet. Other commands that take numbers are also silent, however the code appears to use decimal. For example, -stack-list-args and friends use atoi -- which is 10-base. - Volodya