Re: [RFC] "single step" atomic instruction sequences as a whole on PPC

Daniel Jacobowitz
2007-05-10T23:25:34Z

On Fri, May 11, 2007 at 12:58:28AM +0200, Ulrich Weigand wrote:
> Daniel Jacobowitz wrote:
> > On Thu, May 10, 2007 at 11:30:53PM +0200, Ulrich Weigand wrote:
> > > This looks just like a problem we fixed for the combined debugger;
> > > cancel_breakpoints_callback should cancel SIGTRAP events caused by
> > > software single-step breakpoints just the same as those caused by
> > > other breakpoints.
> >
> > Maybe it would be more elegant to anticipate the day that single step
> > breakpoints are completely normal: make breakpoint_inserted_here_p
> > check them? This is already the only caller.
>
> Good point. Something like the patch below? I've also added the
> check to software_breakpoint_inserted_here_p; that seemed to make
> more sense that not.
>
> (I'm suspicious about adjust_pc_after_break, the only caller of
> software_breakpoint_inserted_here_p anyway; I think this may no
> longer be correct after the software single-step changes ...)

Yes, while I was checking for callers of breakpoint_inserted_here_p
I noticed that. There's no way this is correct any more; it only
works because PowerPC has DECR_PC_AFTER_BREAK == 0 and all other
targets have a software_single_step routine which always returns
the same value.

I think your patch is OK. I suspect that it means the
singlestep_breakpoints_inserted_p check in adjust_pc_after_break is
now obsolete; what do you think? That lets the function simplify a
bit further.

--
Daniel Jacobowitz
CodeSourcery