摘要 |
A tracking method for embedded systems is disclosed. A stacking way is used for viewing and tracing. In the beginning, a program counter (PC) and a stack segment of a function are found out. Then an instruction of the function is learned according to the stack segment and further stack size of the function is calculated. In accordance with the stack size, a stack frame is viewed to find out a recursive program counter of a previous function. Next according to the recursive program counter, an entry point of the previous function is calculated. Therefore, the system knows the memory block is required by which function and further finds out what causes computer shut-down or program errors. Moreover, stack status before the error occurred in the stack frame is got so as to get a returning path that enables the processor going back to status before the error occurred.
|