This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Instrcutions that must not be stepped.


On Wed, 2006-06-07 at 22:26 -0400, Daniel Jacobowitz wrote:
> On Wed, Jun 07, 2006 at 05:19:59PM -0700, PAUL GILLIAM wrote:
> > Does there currently exist an arch. independent way to detect
> > instruction sequences that must not be single stepped?  Failing that, is
> > there some hook I can use to implement this for just the PowerPC?
> 
> Nope.  You'd have to add one.

The closer I look at this, the more it looks like a special case of
software single step.  The difference is that it may not have to be for
*every* single step: just those that are trying to step "atomic"
sequences.

I propose changing the meaning of SOFTWARE_SINGLE_STEP_P () from "This
arch has no hardware to do single step and must use software." to "There
may be circumstances where this arch will have to do single stepping
with out hardware support." And make SOFTWARE_SINGLE_STEP return 1 if a
software single step was needed and 0 if it was not.  This would require
a minor change for those arches currently using SOFTWARE_SINGLE_STEP and
a little tweeking in "infrun.c".

The only difference between doing a software single step as it is now
and doing an "atomic single step" is how the decision of where to place
temporary breakpoints is made.

> Reading the instruction before stepping is going to slow down single
> stepping.  Is there some other way we can handle this?

I can't think of any way.  I did some timing runs, with and without
reading the next instruction from the target and in my native ppc64
case, it wasn't too bad.  Any way, it would only be a hit on arches that
needed it.  And if it was real bad, we could let the user decide.

-=# Paul #=-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]