OK, submitting on behalf of teawater and myself, this is a sync and update to cvs head of the process record save/restore patch. I've split it into 3 parts to make it easier to review. This first part simply abstracts some deeply indented code out of record_wait into its own function, record_exec_entry. The later patches will call this function.