https://sourceware.org/gdb/onlinedocs/gdb/Hooks.html says: a pseudo-command, ‘stop’ exists. Defining (‘hook-stop’) makes the associated commands execute every time execution stops in your program: before breakpoint commands are run, displays are printed, or the stack frame is printed. I wish it would also say: a pseudo-command, ‘resume’ exists. Defining (‘hook-resume’) makes the associated commands execute every time execution resumes in your program. For a description of how this could be used for debugging timing code, see https://github.com/daveyostcom/DateTimeDebug