From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7193 invoked by alias); 12 Jan 2008 16:03:46 -0000 Received: (qmail 7184 invoked by uid 22791); 12 Jan 2008 16:03:46 -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; Sat, 12 Jan 2008 16:03:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D78F62A97A5; Sat, 12 Jan 2008 11:03:16 -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 b0HHZPMx7Ysl; Sat, 12 Jan 2008 11:03:16 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0EACB2A97A1; Sat, 12 Jan 2008 11:03:16 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id ACCE0E7ACB; Sat, 12 Jan 2008 08:02:33 -0800 (PST) Date: Sat, 12 Jan 2008 16:03:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: Mark Kettenis , gdb-patches@sourceware.org Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? Message-ID: <20080112160233.GF9143@adacore.com> References: <1200001622.14654.29.camel@localhost.localdomain> <200801102208.m0AM8aDR023344@brahms.sibelius.xs4all.nl> <20080111053547.GB12954@adacore.com> <200801111126.m0BBQQDB006618@brahms.sibelius.xs4all.nl> <20080111182136.GD12954@adacore.com> <200801112113.m0BLDnAF024595@brahms.sibelius.xs4all.nl> <200801121531.m0CFVW8I023504@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/msg00309.txt.bz2 > > *FUNCTION and *FILENAME:FUNCTION are just special cases of *EXPRESSION > > "*FUNCTION" is generally not a useful C expression, unless FUNCTION > returns a pointer. So I don't want to rely on the user to guess this > magic in GDB. Actually, FUNCTION is a degenerated form of EXPRESSION, and the result depends on the language. In C, FUNCTION refers to the function pointer whereas "FUNCTION ()" refers to the return value from a call to FUNCTION. So, in C, *FUNCTION is the first instruction of our function. However, in Ada, calls to parameterless function are made by just using the name of that function. For instance: A := Get_A; So the, when you say "break *FUNCTION", then GDB will first call FUNCTION, and break at the value returned by that function. So you have to use "break *FUNCTION'Address", or more simply "break *&FUNCTION" should work. But I still agree that it would be useful to describe the special case *FUNCTION, as it is a very useful idiom. -- Joel