From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15975 invoked by alias); 13 Apr 2005 10:36:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15911 invoked from network); 13 Apr 2005 10:36:25 -0000 Received: from unknown (HELO dmz.algor.co.uk) (62.254.210.145) by sourceware.org with SMTP; 13 Apr 2005 10:36:25 -0000 Received: from alg158.algor.co.uk ([62.254.210.158] helo=olympia.mips.com) by dmz.algor.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 1DLfGn-0003mx-00; Wed, 13 Apr 2005 11:38:53 +0100 Received: from perivale.mips.com ([192.168.192.200]) by olympia.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1DLfDW-0007cw-00; Wed, 13 Apr 2005 11:35:30 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 3.36 #1 (Debian)) id 1DLfDV-0003u4-00; Wed, 13 Apr 2005 11:35:29 +0100 Date: Wed, 13 Apr 2005 10:36:00 -0000 From: "Maciej W. Rozycki" To: Daniel Jacobowitz cc: Eli Zaretskii , gdb-patches@sources.redhat.com, "Maciej W. Rozycki" Subject: Re: Support for "break *ADDRESS thread THREADNO" In-Reply-To: <20050412185549.GA9715@nevyn.them.org> Message-ID: References: <20050412181334.GA2560@nevyn.them.org> <01c53f90$Blat.v2.4$17427900@zahav.net.il> <20050412185549.GA9715@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MTUK-Scanner: Found to be clean X-MTUK-SpamCheck: not spam (whitelisted), SpamAssassin (score=-4.636, required 4, AWL, BAYES_00) X-SW-Source: 2005-04/txt/msg00109.txt.bz2 On Tue, 12 Apr 2005, Daniel Jacobowitz wrote: > > Why was it done like this? because "*ADDRESS" is interpreted as an > > expression in the current language, or is there some other reason? > > I assume so. It is parsed as an expression, not just an address; for > instance "break *thread" would actually work if thread is a pointer to > a function. I think the actual problem is the expression parser cannot be told to stop successfully on an unparseable token as long as the expression collected so far is valid and let the caller deal with that. AFAICS the parser can only stop on a string terminator or optionally a comma, otherwise it issues an error. > There's already common code for this, that's where most of the 'thread > THREADNO' support is. I think it's in linespec.c somewhere, but it > might be in breakpoint.c. It seems to need a little extra help from > the language... we need to know that a 'thread NUMBER' suffix is not > part of the expression. It's in break_command_1() actually, so that's breakpoint.c. > TBH, the mechanism is fragile; I can't think of a more robust way but > there must be one. Right now if and thread are handled similarly. But > if separates two expressions, whereas thread can only be followed by a > thread number. Perhaps that can be used to simplify. The current syntax is good enough to be unambiguous -- it's just it's not parsed correctly. But if you find it inadequate, I won't insist on keeping it. Maciej