1. An apparatus for debugging, the apparatus comprising: a memory configured to store data; an arithmetic logic unit configured to perform logical and arithmetic operations; and a control unit configured to interface with the memory and arithmetic logic unit and to decode instructions, wherein the control unit is configured to write a current data state to a buffer allocated in the memory when the current data state will be overwritten by a currently executing instruction.