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 data state designated to be overwritten by a currently executing instruction to a buffer allocated in the memory in response to a trace debug flag being set.