From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7573 invoked by alias); 30 Jul 2002 06:52:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7566 invoked from network); 30 Jul 2002 06:52:28 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 30 Jul 2002 06:52:28 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 8DBC15EA11; Tue, 30 Jul 2002 01:52:26 -0500 (EST) To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] breakpoints and function prologues... References: <20020722231957.GE4999@gnat.com> <20020726053320.GB10000@gnat.com> From: Jim Blandy Date: Mon, 29 Jul 2002 23:57:00 -0000 In-Reply-To: <20020726053320.GB10000@gnat.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00576.txt.bz2 Joel Brobecker writes: > Another alternative that has been discussed at ACT is to move the line > where the function declaration is located to an address immediately > past the function prologue. And the prologue would get a separate line > info entry with a line number set to 0. The rationale behind modifying > the compiler is that the compiler knows much better than GDB what part > of the code is the prologue, and therefore should be in a better > position of to provide accurate line information. There's already a convention for this, I think. Now, where was it described??? Here it is: int in_prologue (CORE_ADDR pc, CORE_ADDR func_start) { struct symtab_and_line sal; CORE_ADDR func_addr, func_end; /* We have several sources of information we can consult to figure this out. - Compilers usually emit line number info that marks the prologue as its own "source line". So the ending address of that "line" is the end of the prologue. If available, this is the most reliable method. - The minimal symbols and partial symbols, which can usually tell us the starting and ending addresses of a function. - If we know the function's start address, we can call the architecture-defined SKIP_PROLOGUE function to analyze the instruction stream and guess where the prologue ends. - Our `func_start' argument; if non-zero, this is the caller's best guess as to the function's entry point. At the time of this writing, handle_inferior_event doesn't get this right, so it should be our last resort. */ So, just emit an extra line entry for the prologue.