How do I get GDB to break out of a loop?

后端 未结 4 851
我寻月下人不归
我寻月下人不归 2021-02-02 08:04

I can tell GDB to return from a function immediately with return, and call a function with call myFunction.

But how do I get it break out of th

4条回答
  •  一整个雨季
    2021-02-02 08:51

    One of the ways could be to set the condition of the loop to false. But this would mean that you would have to wait for the current iteration to finish.

    So to summarize the steps would be:
    1. Set a breakpoint at the last line of the loop
    2. Continue
    3. When breakpoint hits, set the loop condition variable to false.

    It won't work as direct break statement though.

提交回复
热议问题