1. A system for storing trace information of a program to debug an error in the program comprising: a PC (Program Counter) register for traversing program codes in the program in an executable order; a main memory buffer for storing one or more of: trace data of the program, an entry data of a subroutine, and an exit data of the subroutine; a first-level memory buffer, being created when the subroutine is called for execution, for storing trace data related to the subroutine execution; means for linking the main memory buffer and the first-level memory buffer, the first-level memory buffer being a subordinate of the main memory buffer; and means for deleting the first-level memory buffer and any stored trace data when the subroutine completes execution.