This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] add 'rs6000_in_function_epilogue_p()'
- From: Paul Gilliam <pgilliam at us dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: Daniel Jacobowitz <drow at false dot org>, Jim Blandy <jimb at red-bean dot com>, gdb-patches at sources dot redhat dot com
- Date: Fri, 2 Dec 2005 11:46:54 -0800
- Subject: Re: [PATCH] add 'rs6000_in_function_epilogue_p()'
- References: <200511301225.56802.pgilliam@us.ibm.com> <8f2776cb0512011707p120df411w3a685c453d4ec625@mail.gmail.com> <20051202011703.GA27515@nevyn.them.org>
- Reply-to: pgilliam at us dot ibm dot com
On Thursday 01 December 2005 17:17, Daniel Jacobowitz wrote:
> On Thu, Dec 01, 2005 at 05:07:24PM -0800, Jim Blandy wrote:
> > Paul wanted to fast-track this patch, in hopes it could get into the
> > 6.4 release. Joel, what are your thoughts?
>
> I'm opposed. The patch is a serious hack - it assumes that the exit of
> the function is near the end of the function - and I think we need to
> think about the underlying issues a bit. It's also for a very minor
> bug.
>
This patch does *not* assume that the exit of the function is near the end 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, execution 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, execution *is* in an epilogue, return.
b) Stop scanning if you reach the beginning of the function.
Some other points:
* The PowerPC would not be the only architecture that uses 'gdbarch_in_function_epilogue_p()'.
* Danial may characterize the inability to watch a local variable as a very minor bug, but if a user (we have one) is
so desperate with a bug of their own that they see *software* watchpoints as a needed tool, I don't think they would
characterize this is "very minor". 8-)
* I know that this is a hack. It really is a fall-back-hack, as Jim Blandly aluded to in his posting:
http://sourceware.org/ml/gdb-patches/2005-12/msg00028.html
* If the 'underlying cause' Jim refers to gets fixed, the hack will no longer be executed and it
could be removed, or it could stay.
* I would prefer the 'right' fix and will presue it, but for right now, this patch 'fixes' a bug and all though
it's a hack, it is isolated and easly addressed once the 'right' fix is found.