In the conventional technology for the event tracing using a debugger, as described in Japanese Patent Application Laid-Open Publication No. 2001-34503 (Patent Document 1), an event is generated at an arbitrary position on a program by using a breakpoint, the program in execution is stopped, and then, the information of the stopped program is referred and acquired. By this means, the tracing is performed.
Two types of technologies are known for the technology of the breakpoint. The first is the hardware break provided as a debugging function of a CPU, and the second is the software break in which a part of the program to be debugged is replaced with a trap command.
Further, in addition to the two types of event tracing, as a method for checking the behavior of a program, the real-time tracing is known. Also, as described in Japanese Patent Application Laid-Open Publication No. 11-24959 (Patent Document 2), a method in which the tracing information is transmitted by a variable-length packet has been proposed as a technique for improving the real-time property of the real-time tracing function.
In the event tracing using the software break according to the conventional technology, the position of a program where the event is acquired is specified by a debugger. The debugger converts the specified position of the program into an address value on an execution module of the program, and replaces a command of the address value of the execution module stored on a memory of a target board (system to be debugged) with a trap command of a CPU. If the trap command is executed when a CPU is executing the program, the CPU stops by its own function. The memory reference, the register reference, and the tracing of the stack are performed during the time when the CPU is stopped, and the information thereof is recorded in a buffer together with time information.
Further, when acquiring the event information using the hardware break, the position where the event is acquired is specified using a debugger. The debugger converts the specified position of a program into an address value on an execution module of the program, and registers it in a breakpoint register present on a CPU of the target board. A value of a program counter and a value of the breakpoint register are compared during the time when CPU is executing the program, and when they match, the CPU stops by itself. The memory reference, the register reference, and the tracing of the stack are performed during the time when the CPU is stopped, and the information thereof is recorded in a buffer together with time information.
Further, the real-time tracing is achieved by using a debugging function of a CPU, the ICE device, and an interface connector. The ICE device and the CPU are directly connected by the interface connector. During the time when the program to be traced is in execution, the debugging function of a CPU monitors a value of a program counter. When a value of the program counter is changed, the debugging function of the CPU records the value in a buffer area of the CPU. When the value recorded in the buffer area exceeds a threshold value, the debugging function of the CPU transmits the data recorded in the buffer to the ICE device. When the ICE device receives the data, it records the data in the buffer of the ICE device together with the time information.
USPTO Backgrounds
USPTO Backgrounds