A computer-implemented method and system for automatically invoking a predetermined
debugger command at a desired location of a single thread of a program containing
at least one thread. At the desired location of the program thread, there is embedded
a utility which reads a trace file in which the predetermined debugger command
has been previously embedded. Upon re-running the program, the trace file is read
and upon reaching the predetermined debugger command, the debugger attaches itself
to the running process and executes the process from its current program counter.
The debugger is invoked only if there is a discrepancy between successive runs
of the program.