c – 如何在GDB中跳过循环的多次迭代?

假设我有一个循环,将迭代100次,我想跳过50次迭代,但我想继续从那里按下以查看每一行.

我不想在循环之后设置断点,因为这样我将跳过所有迭代,而不仅仅是我想要的数字.

有没有办法在GDB中这样做?怎么样?

附:我不想从头到尾继续按下.这很费时间……

解决方法

在循环中设置断点,然后调用c 50继续50次

Debugging with GDB

5.2 Continuing and stepping

continue [ignore-count] c [ignore-count] fg [ignore-count] Resume program execution,at the address where your program last stopped; any breakpoints set at that address are bypassed. The optional argument ignore-count allows you to specify a further number of times to ignore a breakpoint at this location; its effect is like that of ignore (see section Break conditions). The argument ignore-count is meaningful only when your program stopped due to a breakpoint. At other times,the argument to continue is ignored.

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...