From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2874 invoked by alias); 16 Nov 2011 16:32:04 -0000 Received: (qmail 2847 invoked by uid 22791); 16 Nov 2011 16:32:00 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Nov 2011 16:31:47 +0000 Received: by vcbfo11 with SMTP id fo11so821837vcb.0 for ; Wed, 16 Nov 2011 08:31:46 -0800 (PST) Received: by 10.224.194.5 with SMTP id dw5mr20645864qab.16.1321461106790; Wed, 16 Nov 2011 08:31:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.194.5 with SMTP id dw5mr20645849qab.16.1321461106563; Wed, 16 Nov 2011 08:31:46 -0800 (PST) Received: by 10.224.6.76 with HTTP; Wed, 16 Nov 2011 08:31:46 -0800 (PST) In-Reply-To: References: <20111028221459.GA28467@host1.jankratochvil.net> <20111104074543.GA13839@host1.jankratochvil.net> Date: Wed, 16 Nov 2011 16:32:00 -0000 Message-ID: Subject: Re: RFA: implement ambiguous linespec proposal From: Doug Evans To: Tom Tromey Cc: Jan Kratochvil , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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: 2011-11/txt/msg00434.txt.bz2 On Wed, Nov 16, 2011 at 6:54 AM, Tom Tromey wrote: >>>>>> "Doug" =3D=3D Doug Evans writes: > > Doug> Another question while we're cleaning up linespecs, if I may. > Doug> The docs have this: > > Doug> @item '@var{filename}'::@var{funcaddr} > Doug> Like @var{funcaddr} above, but also specifies the name of the source > Doug> file explicitly. =A0This is useful if the name of the function does= not > Doug> specify the function unambiguously, e.g., if there are several > Doug> functions with identical names in different source files. > > Doug> Is the double colon, ::, a typo? =A0I've only ever seen filename > Doug> delimited with a single colon. > > This form is only valid for expressions, that is, if you type > > =A0 =A0break *'file.c'::function > > This is a syntax extension that gdb provides. =A0See the 'block' > production in c-exp.y. Sigh. :-( > Doug> I'm hoping we can trivially decide that a file name is present by > Doug> seeing a single colon. > > In general I agree, but there are some corner cases to consider. > > There's the easy(-ish) corner case of DOS file names: > > =A0 =A0break c:/file.c:function > > There's also an Objective C case where a trailing ":" is part of the > function name. =A0I forget the exact syntax, maybe it can only appear in > brackets: > > =A0 =A0break +[method:] I don't mind having code to catch these. They're not normal file names. > Anyway, like I said in the previous thread, in my view, gdb should > require quoting for all unusual file names. =A0We should try to be > compatible, but we don't have to try too awfully hard, since a lot of > things never worked anyway. It's not clear that the result of this is that we can programmatically determine if a file name is present without having to go see if it's present in the debug info. Did you have something in mind?