From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10205 invoked by alias); 16 Nov 2005 20:13:09 -0000 Received: (qmail 10188 invoked by uid 22791); 16 Nov 2005 20:13:04 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 16 Nov 2005 20:13:04 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1EcTeO-0006BF-7d; Wed, 16 Nov 2005 15:13:00 -0500 Date: Wed, 16 Nov 2005 23:28:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: Andrew STUBBS , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix 'Undefined command' error message Message-ID: <20051116201300.GA23472@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , Andrew STUBBS , gdb-patches@sources.redhat.com References: <4379EC0A.3060601@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00252.txt.bz2 On Tue, Nov 15, 2005 at 08:13:38PM +0200, Eli Zaretskii wrote: > > Date: Tue, 15 Nov 2005 14:09:14 +0000 > > From: Andrew STUBBS > > > > - while (isalnum (*p) || *p == '-') > > + while (*p && (isalnum (*p) || *p == '-' || *p == '_' || > > Why is there a need for testing *p to be non-zero? AFAIK, isalnum is > well defined for a zero argument. Just to clarify when the end of the loop is? You're right, it should not be necessary. > > +#if defined(TUI) > > + (tui_active && > > + (*p == '+' || *p == '<' || *p == '>' || *p == '$')) || > > +#endif > > What is the reason for additional tests under TUI? The TUI has commands which include these. E.g. + is scroll forward; search for add_com in tui/. > > + (xdb_commands && (*p == '!' || *p == '/' || *p == '?')))) > > Is this for some kind of compatibility with XDB? And xdb has some commands which include these, which GDB emulates, I presume. ! is for an xdb-specific alias to shell. (With a comment from Andrew above it mentioning that using a different syntax would be more useful. Personally, I think we don't need to bind ! to that so much as we need to bind it to bash-style command history.) / and ? are bound to forward and reverse search in the source file. Found these with grep also, although it took me a little longer. Does anyone use xdb compatibility any more? I suspect we could remove it, but I've no way to know. The other characters could presumably be allowed unconditionally without doing any harm, but I haven't tried that. -- Daniel Jacobowitz CodeSourcery, LLC