Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Gilliam <pgilliam@us.ibm.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,
	Jim Blandy <jimb@red-bean.com>,
	        gdb-patches@sources.redhat.com
Subject: Re: [PATCH] add 'rs6000_in_function_epilogue_p()'
Date: Fri, 02 Dec 2005 20:12:00 -0000	[thread overview]
Message-ID: <200512021146.54036.pgilliam@us.ibm.com> (raw)
In-Reply-To: <20051202011703.GA27515@nevyn.them.org>

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.


WARNING: multiple messages have this Message-ID
From: Paul Gilliam <pgilliam@us.ibm.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,
	Jim Blandy <jimb@red-bean.com>,
	        gdb-patches@sources.redhat.com
Subject: Re: [PATCH] add 'rs6000_in_function_epilogue_p()'
Date: Fri, 02 Dec 2005 20:17:00 -0000	[thread overview]
Message-ID: <200512021146.54036.pgilliam@us.ibm.com> (raw)
Message-ID: <20051202201700.des1PlyltELlD8iNsszv55QksK9xuoSeaDtvjUzO6_A@z> (raw)
In-Reply-To: <20051202011703.GA27515@nevyn.them.org>

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.


  reply	other threads:[~2005-12-02 19:15 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 23:56 Paul Gilliam
2005-12-01  5:21 ` Jim Blandy
2005-12-01 18:27   ` Paul Gilliam
2005-12-01 20:14     ` Paul Gilliam
2005-12-02  1:13 ` Jim Blandy
2005-12-02  1:23   ` Daniel Jacobowitz
2005-12-02 20:12     ` Paul Gilliam [this message]
2005-12-02 20:17       ` Paul Gilliam
2005-12-03  3:05       ` Jim Blandy
2005-12-02 23:38         ` Jim Blandy
2005-12-04 20:19         ` Daniel Jacobowitz
2005-12-04 18:59           ` Daniel Jacobowitz
2005-12-04 20:48           ` Jim Blandy
2005-12-04 21:12             ` Jim Blandy
2005-12-04 21:16             ` Daniel Jacobowitz
2005-12-04 21:22               ` Jim Blandy
2005-12-02  4:02   ` Joel Brobecker
2005-12-02 18:44   ` Mark Kettenis
2005-12-02 19:15   ` [PATCH] add 'rs6000_in_function_epilogue_p()' (Revised) Paul Gilliam
2005-12-02 20:28     ` Mark Kettenis
2005-12-02 21:19       ` Daniel Jacobowitz
2005-12-02 21:21         ` Mark Kettenis
2005-12-03  4:53       ` [PATCH] add 'rs6000_in_function_epilogue_p()' (Revised, again) Paul Gilliam
2005-12-03  5:43         ` Paul Gilliam
2005-12-02 21:44     ` [PATCH] add 'rs6000_in_function_epilogue_p()' (Revised) Kevin Buettner
2005-12-06 15:20       ` Paul Gilliam
2005-12-06 15:15         ` Paul Gilliam
2005-12-08  4:42         ` Kevin Buettner
2006-01-11 17:44       ` Paul Gilliam
2006-01-12  0:12         ` Paul Gilliam
2006-01-12 23:53           ` Paul Gilliam
2006-01-13 21:05             ` Mark Kettenis
2006-01-17  3:46               ` Paul Gilliam
2006-01-17 19:29                 ` Mark Kettenis
2006-02-09 17:46                 ` Kevin Buettner
2005-12-02 22:19     ` Jim Blandy
2005-12-02 22:28       ` Daniel Jacobowitz
2005-12-02 23:20         ` Jim Blandy
2005-12-03 12:48       ` Paul Gilliam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200512021146.54036.pgilliam@us.ibm.com \
    --to=pgilliam@us.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@red-bean.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox