How to re-run program in GDB several times?

前端 未结 2 512
星月不相逢
星月不相逢 2021-02-08 11:43

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:

2条回答
  •  甜味超标
    2021-02-08 12:09

    The simplest solution I can think of is to run program in infinite while loop until it fails or you press Ctrl+C to break the loop.

    (gdb) while 1
     >run
     >end
    

提交回复
热议问题