From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18278 invoked by alias); 16 Jan 2008 04:15:02 -0000 Received: (qmail 18204 invoked by uid 22791); 16 Jan 2008 04:15:00 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (213.8.233.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 16 Jan 2008 04:14:40 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-233-24.inter.net.il [83.130.233.24]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id IWF66966 (AUTH halo1); Wed, 16 Jan 2008 06:12:05 +0200 (IST) Date: Wed, 16 Jan 2008 04:15:00 -0000 Message-Id: From: Eli Zaretskii To: "Ulrich Weigand" CC: brobecker@adacore.com, msnyder@specifix.com, mark.kettenis@xs4all.nl, gdb-patches@sourceware.org In-reply-to: <200801152140.m0FLeMha003566@d12av02.megacenter.de.ibm.com> (uweigand@de.ibm.com) Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? Reply-to: Eli Zaretskii References: <200801152140.m0FLeMha003566@d12av02.megacenter.de.ibm.com> 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/msg00377.txt.bz2 > Date: Tue, 15 Jan 2008 22:40:22 +0100 (CET) > From: "Ulrich Weigand" > Cc: brobecker@adacore.com (Joel Brobecker), msnyder@specifix.com, > mark.kettenis@xs4all.nl, gdb-patches@sourceware.org > > 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 >