From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19408 invoked by alias); 15 Jan 2008 21:40:47 -0000 Received: (qmail 19398 invoked by uid 22791); 15 Jan 2008 21:40:47 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 15 Jan 2008 21:40:26 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id m0FLeNUG196938 for ; Tue, 15 Jan 2008 21:40:23 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m0FLeNMT3010604 for ; Tue, 15 Jan 2008 22:40:23 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m0FLeM5m003569 for ; Tue, 15 Jan 2008 22:40:23 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m0FLeMha003566; Tue, 15 Jan 2008 22:40:22 +0100 Message-Id: <200801152140.m0FLeMha003566@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 15 Jan 2008 22:40:22 +0100 Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? To: eliz@gnu.org Date: Tue, 15 Jan 2008 21:40:00 -0000 From: "Ulrich Weigand" Cc: brobecker@adacore.com (Joel Brobecker), msnyder@specifix.com, mark.kettenis@xs4all.nl, gdb-patches@sourceware.org In-Reply-To: from "Eli Zaretskii" at Jan 15, 2008 08:47:05 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00370.txt.bz2 Eli Zaretskii wrote: > > Date: Tue, 15 Jan 2008 04:38:32 -0800 > > From: Joel Brobecker > > > > > By the way, has anyone tried *FILENAME:FUNCTION? I'm surprised that > > > works, since it would have to be part of the C parser. > > > > Confirmed - it doesn't work. > > Which is a bug, IMO: if FUNCTION works, so should FILENAME:FUNCTION, > otherwise GDB is inconsistent in its treatment of locations specs. Actually, I disagree that this is inconsistent. The point is that the EXPRESSION part of a *EXPRESSION location spec is *not* itself a location spec, but an *expression*. The set of valid expressions varies with the language, but none of them support any string of the form FILENAME:FUNCTION as expression. However, for *some* languages (e.g. C, but not Ada), a function name happens to be a valid expression that evaluates to the address of that function. It is only due to that "accident" that break *FUNCTION does indeed set a breakpoint at the address of FUNCTION (assuming the current language is C). On the other hand, if FP happens to be the name of a function pointer variable, break *FP will -by the same rules- set a break point on the function currently pointed to (while "break FP" does not work at all). So, in short, I fully agree with the point raised by Mark that *FUNCTION should *not* be documented as a feature of location specs, because *there is no such feature*. The feature that actually exists is *EXPRESSION where EXPRESSION is simply any expression of the current language that is evaluated to result in a machine address. (Of course, there could be examples of typical usage of that feature that explain the idiom to use *FUNCTION while in the C language, and how that differs in practice from using FUNCTION as a location spec.) Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com