From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 446 invoked by alias); 17 Jan 2008 18:38:36 -0000 Received: (qmail 437 invoked by uid 22791); 17 Jan 2008 18:38:36 -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; Thu, 17 Jan 2008 18:38:06 +0000 Received: (qmail 22482 invoked from network); 17 Jan 2008 18:37:59 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Jan 2008 18:37:59 -0000 To: Eli Zaretskii Cc: mark.kettenis@xs4all.nl, uweigand@de.ibm.com, brobecker@adacore.com, msnyder@specifix.com, gdb-patches@sourceware.org Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? References: <200801152140.m0FLeMha003566@d12av02.megacenter.de.ibm.com> <200801161034.m0GAYfpk000326@brahms.sibelius.xs4all.nl> From: Jim Blandy Date: Thu, 17 Jan 2008 18:38:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Thu, 17 Jan 2008 06:13:11 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-01/txt/msg00451.txt.bz2 Eli Zaretskii writes: >> Cc: Mark Kettenis , uweigand@de.ibm.com, >> brobecker@adacore.com, msnyder@specifix.com, >> gdb-patches@sourceware.org >> From: Jim Blandy >> Date: Wed, 16 Jan 2008 13:36:11 -0800 >> >> GDB allows 'FILENAME'::FUNCTION in C expressions: > > Thanks. > > But if "break *'FILENAME'::FUNCTION" works, why is it wrong to expect > that "break *FILENAME:FUNCTION" should also work. None of them is a > valid C expression, it's just something GDB does to help the user, > right? Our goal here is for GDB to provide memorable, predictable, terse ways for people to describe locations for breakpoints, listings, and so on. There should be terse, memorable ways to specify every form one needs in daily use. The '*EXPRESSION' form is an escape hatch for those cases that fall outside daily use. Setting breakpoints in functions before stack frame and argument setup instructions is an obscure corner case that only people writing or generating assembly code (say, compiler authors) or people working on GDB need. The '*EXPRESSION' escape hatch syntax is adequate for such users. To make 'break *FILENAME:FUNCTION' work, there are two approaches: - We could extend GDB's C grammar to treat 'FILENAME:FUNCTION' as a valid expression. However, if not quoted, many FILENAMES would be ambiguous with other C expressions --- for example, is foo.c a filename, or a reference to the member 'c' of a structure or union 'foo'? If that problem could be resolved, the use of ':' would still be ambiguous with the ?: operator. - We could extend the linespec syntax to recognize '*FILENAME:FUNCTION' specially, and not try to parse 'FILENAME:FUNCTION' as an expression. But who does this serve? The people setting breakpoints at function entry points won't find this helpful, as it just introduces ambiguities and special cases into a grammar that already does the job for them. And other users don't want to set breakpoints there.