port jiawen's code to allow debugging of suspend code