Single-stepping

Richard Hirst rhirst@linuxcare.com
Thu, 16 Nov 2000 20:28:42 +0000


On Thu, Nov 16, 2000 at 11:00:48AM -0800, Frank Rowand wrote:
> John Marvin wrote:
> > > > Does this code properly handle branches in the delay slot of another
> > > > branch? (you need to make sure you are not advancing the queues by just
> > > > adding 4 to each element).  One concern I have about this method is that
> > >
> > > Current code does
> > >
> > >     /* Nullified, just crank over the queue. */
> > >     task_regs(child)->iaoq[0] = task_regs(child)->iaoq[1];
> > >     task_regs(child)->iasq[0] = task_regs(child)->iasq[1];
> > >     task_regs(child)->iaoq[1] = task_regs(child)->iaoq[0] + 4;
> > >
> > > Does that look right to you?
> > >
> > 
> > Yes, that is the correct way to do it (I'll assume the duplicated line
> > is just a cut/paste error).
> 
> If iaoq[0] contains a branch, iaoq[1] is in the delay slot.  The instruction
> executed after iaoq[1] would then typically _not_ be iaoq[0] + 4 (the next
> instruction would be the target of the branch at iaoq[0]).

But the above code is only executed if the current instruction is
nullified.  In your example, the branch in iaoq[0] would be
nullified and therefore never taken.

Richard