From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16715 invoked by alias); 20 Jan 2008 15:03:03 -0000 Received: (qmail 16703 invoked by uid 22791); 20 Jan 2008 15:03:01 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 20 Jan 2008 15:02:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9ED3F2A96E7; Sun, 20 Jan 2008 10:02:40 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AHaEOc0R-Cgc; Sun, 20 Jan 2008 10:02:40 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id B52852A96E1; Sun, 20 Jan 2008 10:02:39 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 4F60BE7ACB; Sun, 20 Jan 2008 07:02:24 -0800 (PST) Date: Sun, 20 Jan 2008 15:03:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: Jim Blandy , mark.kettenis@xs4all.nl, uweigand@de.ibm.com, msnyder@specifix.com, gdb-patches@sourceware.org Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? Message-ID: <20080120150224.GI28020@adacore.com> References: <200801152140.m0FLeMha003566@d12av02.megacenter.de.ibm.com> <200801161034.m0GAYfpk000326@brahms.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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/msg00497.txt.bz2 Hi Eli, I think this is a great improvement in terms of clarity. Thanks! > -@item @var{filename}:@var{number} > -Specifies line @var{number} in the source file @var{filename}. > +@item @var{filename}:@var{linenum} > +Specifies the line @var{linenum} in the source file @var{filename}. > > @item @var{function} > Specifies the line that begins the body of the function @var{function}. > -For example: in C, this is the line with the open brace. > +For example, in C, this is the line with the open brace. This is actually not true. It's usually the first line of code past the open brace. > As a convenience, @value{GDBN} extends the semantics of > +expressions used in locations to cover the situations that frequently > +happen during debugging. I was a little bit confused at first by this sentence, as I thought that you were saying that all the forms you are describing later are extensions, which as you explain for C/C++/etc is not the case. At the same time, I found it pretty hard to try to do better. Perhaps if we took a different approach and made a subsection that describe expressions that return the address of a function, and why they are useful, then maybe we would be able to unconfuse things. For instance: Breaking on the first instruction of a function: Inserting a breakpoint on a function will result as documented at ... in a breakpoint at the first line of code inside the body of that function. Instead, you might sometimes want to break on the very first instruction of that function, inside the function prologue. To do that, you should use the *address linespec syntax, where address is an expression valid in the current language that returns the address of your function. All languages provide a way of getting a function address from its name, either as a valid expression for that language, or as an extension to this language. Here they are: - C/C++/etc...: function_name. - Pascal and M2: &function_name. - Ada: function_name'Address. &function_name can also be used as an extension. Hope this helps :) -- Joel