tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: Debugging threaded processes -- ptrace proposal



Gentlepeople,

It's clear that GDB requires a way to step and resume single threads,
which currently doesn't exist.  (I checked the analogous procfs
machinery -- it doesn't have that either, and in fact it is behind
ptrace because it doesn't even have a way to do *any* operations on
threads other than the first one.)

The minimal change I can see is to add a way to select the thread to
operate on in PT_STEP and PT_CONTINUE.

For PT_STEP that's easy: use the "data" argument as the LWPID if
non-zero, exactly as is already done for PT_GETREGS and the like.

For PT_CONTINUE it's a bit harder, because there aren't any unused
arguments.  A way to deal with this uses the fact that single thread
resume never wants to deliver a signal (which makes sense, because
signals go to processes).  So I propose to use the "data" argument with
a negative value (the negative of the LWPID) to mean "continue only this
thread".

Comments?  Alternative/better ways of doing this?

        paul


Home | Main Index | Thread Index | Old Index