ongoing refactorings

Robert O'Callahan robert at ocallahan.org
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
treatment.

Rob
-- 
oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo
owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo
osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo
owohooo
osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o
oioso
oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo
owohooo
osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro
ooofo
otohoeo ofoioroeo ooofo ohoeololo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rr-dev/attachments/20141014/3832380a/attachment.html>


More information about the rr-dev mailing list