All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] Single-stepping
@ 2000-11-15 18:48 Richard Hirst
  2000-11-15 19:49 ` John David Anglin
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Hirst @ 2000-11-15 18:48 UTC (permalink / raw)
  To: parisc-linux

(Oops, CC-ed to the wrong list first time!)

Hi John,
  I've been helping Alan Modra out with kernel changes to support
single stepping for gdb.  Paul Bame suggested I bounced our ideas
off you in case you (or anyone else) had any comments.  I havn't
actually committed my changes yet.

The basic approach is to use the recovery counter to generate
a trap every instruction.  The scheme is complicated because a
suspended process may or may not return to user space via an RFI.

If it was suspended as a result of an interrupt then we can
simply set PSW bit R in the tasks saved registers and it will
get loaded by the RFI.  On every task switch I set the
recovery counter to 0, just in case the new process is being
single-stepped.

If a process is suspended during a syscall, then there is no
RFI on the return path to userland, and we have to handle things
differently.  I have changed the syscall return path such that
it loads the recovery counter with 3 before updating the PSW
with a value from the tasks saved registers.  If that PSW has
the R bit set, then the count of 3 will generate a trap on the
first instruction following the branch back to user space.
Note that PSW wasn't previously restored on the syscall return
path.

To avoid further complications of interrupts during the three
instructions when the recovery counter is decrementing, whenever
we set the R bit, we also clear the I bit to disable interrupts.

Nullified instructions are handled by the controlling process
manually moving the childs IAOQ over the instruction without
actually setting it running, because the recovery counter isn't
decremented for nullified instructions.

I need to do some more testing before committing this, but would
welcome any comments on the basic approach taken, areas I have
mis-understood, or problems with it that might not yet have
occurred to me.

Thanks,
  Richard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-11-16 12:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-15 18:48 [parisc-linux] Single-stepping Richard Hirst
2000-11-15 19:49 ` John David Anglin
2000-11-15 20:30   ` law
2000-11-15 21:16     ` Frank Rowand
2000-11-15 21:47       ` Stan Sieler
2000-11-15 21:08   ` Stan Sieler
2000-11-16 12:09   ` Richard Hirst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.