From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17121 invoked by alias); 9 Jan 2008 20:01:47 -0000 Received: (qmail 17083 invoked by uid 22791); 9 Jan 2008 20:01:41 -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; Wed, 09 Jan 2008 20:01:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 02CAB2A96BF; Wed, 9 Jan 2008 15:01:22 -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 6LGnnn14P+Ul; Wed, 9 Jan 2008 15:01:21 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 2511C2A96BD; Wed, 9 Jan 2008 15:01:21 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id BF192E7ACB; Wed, 9 Jan 2008 12:01:13 -0800 (PST) Date: Wed, 09 Jan 2008 20:01:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue? Message-ID: <20080109200113.GG21281@adacore.com> References: <20080109151745.GA13181@adacore.com> <200801091916.m09JGLPd004324@brahms.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200801091916.m09JGLPd004324@brahms.sibelius.xs4all.nl> 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/msg00215.txt.bz2 > > 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). > > You've got me confused here. How can it be that if skipping using the > line table helps, the breakpoint location (which I assume has been > determined based on the line table) isn't right to begin with? Actually, the line table *is* correct. Assuming the following code: 1 void 2 call_me (int number) 3 { 4 dial (number); Typically, the linetable will have the following entries: line 3: line 4: etc... What I'd like GDB to do is, when the user decides to break on line 2 or 3, to find the address of line 3, realize that it is in the function prologue, and then skip line 3 until finding the "first line of real code" (in this case, it's easy, line 4). Since we are breaking by line number in this case, we know we have a linetable for our function, and finding the "first line of real code" (sic from symtab.c:find_function_start_sal description) is more robust when you rely on debugging info than on prologue scanning. > Ultimately, the problem is that GCC is (still) generating the wrong > debug information, since either: I completely agree, but I don't think the compiler is going to be fixed anytime soon. I propose to be pragmatic and modify the GDB behavior so that we do a more useful job with what we have now. Eventually, when we have better debugging info, we can stop skipping the function prologue in all cases if we want. As an aside, I have to say that I find the prologue skipping extremely convenient regardless of parameter display, because the large majority of the time, I don't want to stop before the prologue only to have to "next/step" over it right after. I'd rather stop in the function body immediately. So removing the prologue skipping would be a regression in usability in my opinion. -- Joel