ongoing refactorings

Robert O'Callahan robert at
Mon Oct 13 16:11:49 PDT 2014

I've continued to polish code in various places.

Right now I'm working on a somewhat speculative refactoring. In many places
we call Task methods that eventually result in a did_waitpid call
indicating a waitpid returned a wait status for the Task. Code in the call
chain is responsible for handling the various possible kinds of wait status
(normally a signal or various ptrace events). It's often difficult to track
what is responsible for handling various events and ensure all possible
events are handled. I'd like to clean this up. My current idea is to add a
WaitStatus object generated by did_waitpid and passed up the call chain. It
will offer methods for interrogating the wait status but more importantly
it will represent an obligation to handle the wait status. I intend to add
a flag to the object to indicate if the status was handled, and then the
destructor can assert that it was.

This will probably trigger some code restructuring to reduce the amount of
WaitStatus passing-around we have to do. My instinct is that this will
improve the code.

BTW I got the idea to do this while I was looking into introducing a queue
of pending signals instead of the current incomplete hacks around the
problem. Introducing a queue of pending signals is currently quite
difficult since there are many places where a waitpid could return a new
pending signal and it's difficult to verify we do the right thing at all
those sites. We can't just have did_waitpid automatically push a signal
onto the queue since under some call stacks certain signals need special

oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro
otohoeo ofoioroeo ooofo ohoeololo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the rr-dev mailing list