Debugging the n-th call

the easiest way to debug a crash on the nth call of a piece of code is to set a hardware breakpoint - yduf

This assume the bug is reproducible.

    • run the code until it crash
    • not the place, and set a hardware breakpoint there - with counting enable, but no stop.
    • rerun, note the count N at which crash happens
    • set the breakpoint to break at N -1
    • rerun, and now you are ready to debug in close condition to the crash.

This method allows to rerun close to normal performance and easily understand context of such bug (for eg, when happens after several call of the same functions, or deep in a loop).

see also

Written on March 22, 2024, Last update on September 28, 2024
debug-war debug-c++ yduf strace