large Task refactoring landed

Robert O'Callahan robert at ocallahan.org
Tue Mar 22 02:49:16 UTC 2016


Task was becoming a bit of a problem. It was the biggest single class and
mixed up functionality used during recording (e.g. record_* methods),
during replay (e.g. trace record access), and both. For much of the
functionality (e.g. pending_events) it was unclear whether or how it was
used differently during recording and replay. Also, where a Task* appears
it's often required that the Task be a recording task or a replaying task,
but that's not noted or checked in the type system.

I've fixed most of that by splitting out subclasses of Task, RecordTask and
ReplayTask, that contain all the recording-only or replay-only
functionality and state. Wherever a recording or replay task is required we
use the correct type. This was a lot of code changes but the results are
good. It exposed a few bugs and cleanups. There were a couple of important
substantive changes: I reimplemented clear-tid-futex so it happens entirely
during recording so we don't have to track the current child_tid address
during replay. I removed all usage of pending_events during replay
(handling syscall interruption just by pulling register state out of the
trace) so pending_events is entirely record-only now.

RecordTask is much more complicated than ReplayTask, so it's much easier to
understand replay in isolation now. That's good because replay is where I
plan to do a lot of work.

Rob
-- 
lbir ye,ea yer.tnietoehr  rdn rdsme,anea lurpr  edna e hnysnenh hhe uresyf
toD
selthor  stor  edna  siewaoeodm  or v sstvr  esBa  kbvted,t
rdsme,aoreseoouoto
o l euetiuruewFa  kbn e hnystoivateweh uresyf tulsa rehr  rdm  or rnea
lurpr
.a war hsrer holsa rodvted,t  nenh hneireseoouot.tniesiewaoeivatewt sstvr
esn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rr-dev/attachments/20160322/833cc87c/attachment.html>


More information about the rr-dev mailing list