I have a program which fails sporadically, but with the same error. To debug it I'd like to run it under GDB until it fails, set breakpoints and re-run it. what do I do:
gdb --args /path/to/program <program args>
But I can't find anywhere how do I tell GDB "run this program 100 times" for example.
main()tomy_program()and add aint main()that callsmy_program()100 times? (I know this might break for some of the trickier programs that do things withatexit()etc., but it might serve as a workaround.)