From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20928 invoked by alias); 9 Jan 2008 19:11:26 -0000 Received: (qmail 20917 invoked by uid 22791); 9 Jan 2008 19:11:24 -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; Wed, 09 Jan 2008 19:10:52 +0000 Received: (qmail 27889 invoked from network); 9 Jan 2008 19:10:50 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Jan 2008 19:10:50 -0000 To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? References: <20080109151745.GA13181@adacore.com> From: Jim Blandy Date: Wed, 09 Jan 2008 19:11:00 -0000 In-Reply-To: <20080109151745.GA13181@adacore.com> (Joel Brobecker's message of "Wed, 9 Jan 2008 07:17:45 -0800") 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/msg00204.txt.bz2 Joel Brobecker writes: > I would like to revive a discussion that started sometime in 2002. > The idea is the following: When breaking on a given source line, if > that line is inside a function prologue, skip the prologue (using > the linetable to do so). > > In our experience, we have found that most users are not aware of > the existence of function prologues. When they break on the line > where a function is defined, they think the debugger is doing the > same thing than it would do if it inserted the breakpoint using > that function name. Unfortunately, it doesn't and they end up > having problems trying to print parameter values [1]. > > When we discussed this back in 2002, there wasn't an overwhelming > support for this proposal, but I think that we had mild support. > Both Apple and AdaCore have decided to implement this, and JimB > was also supporting the idea. I searched the archives, and I didn't > really find any negative support. I personally think that it's > friendlier and is usually what the typical user expects. > > The only counter argument, IMO, is the fact that we're changing a > behavior that has been there for a long time... But the current > behavior is currently undocumented (or at least it wasn't in 2002 > :-), and users can use the "break *FUNC_NAME" syntax if they don't > want the prologue to be skipped. Like Jim, I think this syntax > makes better sense - in fact, I have always naturally used the > *FUNC_NAME syntax in these cases, never really used line numbers. > > So I am making this proposal again, with the hope of reaching > a decision, either yes or no. Or, as a compromise, we can control > the behavior through as setting. I would argue for the default value > to change the behavior, since: Deliberately breaking inside the > prologue is a relatively uncommon operation; and the users who expect > to break inside the prologue know what they are doing and will quickly > find a way around. I don't remember the original conversation, but the suggestion still sounds like a good idea to me. (Whew!) > [1]: I think we have made some progress with parameter/variable > tracking with DWARF, but I think it's not activated by default > and we also still support platforms where DWARF is not available. What is "not activated by default", exactly? Is it in GCC? In GDB? Where in GDB? I've long had this dream that eventually we would just stop skipping prologues altogether, because everything would actually work at every instruction in the function.