From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12305 invoked by alias); 2 Dec 2005 22:19:11 -0000 Received: (qmail 12290 invoked by uid 22791); 2 Dec 2005 22:19:10 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.207) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 Dec 2005 22:19:09 +0000 Received: by zproxy.gmail.com with SMTP id x3so262417nzd for ; Fri, 02 Dec 2005 14:19:07 -0800 (PST) Received: by 10.36.146.2 with SMTP id t2mr3079042nzd; Fri, 02 Dec 2005 14:19:07 -0800 (PST) Received: by 10.37.2.6 with HTTP; Fri, 2 Dec 2005 14:19:07 -0800 (PST) Message-ID: <8f2776cb0512021419w5af03946je07634a4400417fd@mail.gmail.com> Date: Fri, 02 Dec 2005 23:38:00 -0000 From: Jim Blandy To: pgilliam@us.ibm.com Subject: Re: [PATCH] add 'rs6000_in_function_epilogue_p()' Cc: gdb-patches@sourceware.org, Daniel Jacobowitz , gdb-patches@sources.redhat.com In-Reply-To: <200512021146.54036.pgilliam@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200511301225.56802.pgilliam@us.ibm.com> <8f2776cb0512011707p120df411w3a685c453d4ec625@mail.gmail.com> <20051202011703.GA27515@nevyn.them.org> <200512021146.54036.pgilliam@us.ibm.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00073.txt.bz2 Message-ID: <20051202233800.8CeNZuXc6-FyVYrL2jvJS6cEH8ZdOM1aWftpRe-JAAA@z> On 12/2/05, Paul Gilliam wrote: > This patch does *not* assume that the exit of the function is near the en= d of the function. > > It's more/less of a hack than that! > > Here is the 'algorithm': > 1) scan forward from the point of execution: > a) If you find an instruction that modifies the stack pointer, execut= ion is not in an epilogue, return. > b) Stop scanning if you find a return instruction or reach the end of= the function. > 2) scan backward from the point of execution: > a) If you find an instruction that modifies the stack pointer, execu= tion *is* in an epilogue, return. > b) Stop scanning if you reach the beginning of the function. (That text belongs in a comment, else Daniel wouldn't have got it wrong!) You know, there's no reason this logic wouldn't be equally useful in the skip_prologue function. If the prologue scan doesn't make it to the PC, then we could do the above, and use it to provide an accurate frame ID. That would fix the bug, and backtraces too.