From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28183 invoked by alias); 21 Jan 2010 21:05:32 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 28173 invoked by uid 22791); 21 Jan 2010 21:05:31 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org From: Tom Tromey To: Jan Kratochvil Cc: Keith Seitz , archer@sourceware.org Subject: Re: [expr] [patch] Fix "break expr if (cond)" regression References: <20100121164053.GA12326@host0.dyn.jankratochvil.net> Reply-To: Tom Tromey Date: Thu, 21 Jan 2010 21:05:00 -0000 In-Reply-To: <20100121164053.GA12326@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Thu, 21 Jan 2010 17:40:53 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2010-q1/txt/msg00028.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> I do not fully agree with my patch but I also do not fully agree Jan> with the former patch, maybe bison should be used to parse the Jan> expression, but rather someone (Tom? unaware) said that "break E Jan> [thread T] [if C]" should be rather changed to the more Jan> parseable+standardized "break [-thread T] [-if C] E" so that these Jan> expression parsing difficulties would be present only as a backward Jan> compatibility and do not need to supersede the former Jan> functionality. In the end gdb went the other route, of making "thread" special in the lexer -- but with a twist: /* For the same reason (breakpoint conditions), "thread N" terminates the expression. "thread" could be an identifier, but an identifier is never followed by a number without intervening punctuation. "task" is similar. Handle abbreviations of these, similarly to breakpoint.c:find_condition_and_thread. */ [...] if (*p >= '0' && *p <= '9') return 0; I think linespecs would be more maintainable if we came up with a grammar for them and implemented them using bison (or any parser generator), but I don't know if that is even possible while preserving compatibility. Tom