Run the application under an interpreter or high-level debugger, and generate a trace of all statements executed.
Determine whether the code was ever executed.
What order were statements executed in?
What statements were and weren’t executed?
You can generate so much data that it becomes overwhelming.
If the problem is caused by stack or heap corruption, running under an interpreter or high-level debugger may cause the symptom to change or disappear because the stack and heap will be different.
Trace only selected statements.
Trace only statements that control others—loop heads, conditional statements.
None.
Traces are only appropriate in a few situations:
The application is legitimately goto oriented. It could be a finite state machine or the output of another program.
The program is written in a very high-level language (VHLL) or in assembly language. In a VHLL, each statement has a high semantic content. In an assembly language, a simulator may be able to provide information not otherwise obtainable.