ptrace & Re: Mark Williams csd
Steven M. Kramer
smk at axiom.UUCP
Fri Dec 28 04:44:22 AEST 1984
I don't know of ANY UNIX debugger that handles tracing/history/single
stepping quickly. This is because ptrace() is so slow! For each
read/write/execution of the child it has to do a context switch. When
you need to read the stack or rearrange breakpoints this can be very
slow, especially if the debugger doesn't optimize the places to single
step.
What we have done here, and I hope this can be adopted as a UNIX standard
is to ass a new form of ptrace request that takes an array of requests in
a buffer (pointed to by the addr parameter), the amt of which is stored in
data. All the ptraces are done at once and the status code is returned for
each in the buffer.
Real benefits come in that there is only one context switch that need occur,
which is great if swapping is done.
Let's think of putting this in into UNIXs of the future. It's prolonging the
ptrace rather than a more comprehensive construct (like an ioctl), but at
least it's compatible and it runs like a bat out of hell.
--
--steve kramer
{allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!axiom!smk (UUCP)
linus!axiom!smk at mitre-bedford (MIL)
More information about the Comp.lang.c
mailing list