From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7367 invoked by alias); 16 Apr 2007 16:03:07 -0000 Received: (qmail 7359 invoked by uid 22791); 16 Apr 2007 16:03:06 -0000 X-Spam-Check-By: sourceware.org Received: from ns.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Apr 2007 17:02:59 +0100 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 3F402122EE for ; Mon, 16 Apr 2007 18:02:57 +0200 (CEST) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: Re: Improve end check on rs6000 prologue analyzer References: <20060929213726.GA1770@nevyn.them.org> <200609301932.k8UJW0kw030997@elgar.sibelius.xs4all.nl> <20061017212114.GC12643@nevyn.them.org> <200610181958.k9IJw88G009044@elgar.sibelius.xs4all.nl> <20070309150504.GA5166@caradoc.them.org> X-Yow: Join the PLUMBER'S UNION!! Date: Tue, 17 Apr 2007 02:02:00 -0000 In-Reply-To: <20070309150504.GA5166@caradoc.them.org> (Daniel Jacobowitz's message of "Fri, 9 Mar 2007 10:05:04 -0500") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.97 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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: 2007-04/txt/msg00252.txt.bz2 Daniel Jacobowitz writes: > 2007-03-09 Daniel Jacobowitz > > * rs6000-tdep.c (rs6000_skip_prologue): Use skip_prologue_using_sal. This is causing a regression when the function is very small. $ cat prologue.c int foo () { return 0; } int main (void) { return foo (); } $ gcc -O2 -g prologue.c $ gdb a.out GNU gdb 6.6.50.20070416-cvs Copyright (C) 2007 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-suse-linux"... Using host libthread_db library "/lib/power4/libthread_db.so.1". (gdb) b foo Breakpoint 1 at 0x10000490: file prologue.c, line 8. (gdb) i b Num Type Disp Enb Address What 1 breakpoint keep y 0x10000490 in main at prologue.c:8 (gdb) Note that the breakpoint is actually in main, not in foo. The problem is that skip_prologue_using_sal does not properly handle a function with only one sal if the pc of the next line is bigger than the end pc of the current function. Andreas. 2007-04-16 Andreas Schwab * symtab.c (skip_prologue_using_sal): Allow the end of the prologue sal to be bigger than the end of the function. --- gdb/symtab.c.~1.156.~ 2007-03-28 12:57:45.000000000 +0200 +++ gdb/symtab.c 2007-04-16 17:39:04.000000000 +0200 @@ -4111,7 +4111,7 @@ skip_prologue_using_sal (CORE_ADDR func_ /* If there is only one sal that covers the entire function, then it is probably a single line function, like "foo(){}". */ - if (prologue_sal.end == end_pc) + if (prologue_sal.end >= end_pc) return 0; while (prologue_sal.end < end_pc) { -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."