gpt4 book ai didi

c++ - 如何跳过 ddd (gdb) 中的过去循环

转载 作者:可可西里 更新时间:2023-11-01 15:46:03 27 4
gpt4 key购买 nike

在许多使用 DDD 进行调试的过程中,有时是大量的调试过程中,我偶然发现了循环。我一直按 next 来跳过它,如果有很多迭代,我就在它后面设置一个断点,然后按“继续”。还有其他方法可以绕过循环吗?

最佳答案

您需要“until”命令 - 请参阅 http://www.gnu.org/software/gdb/documentation 处的 gdb 手册:

Continue running until a source line past the current line, in the current stack frame, is reached. This command is used to avoid single stepping through a loop more than once. It is like the next command, except that when until encounters a jump, it automatically continues execution until the program counter is greater than the address of the jump.

This means that when you reach the end of a loop after single stepping though it, until makes your program continue execution until it exits the loop. In contrast, a next command at the end of a loop simply steps back to the beginning of the loop, which forces you to step through the next iteration.

关于c++ - 如何跳过 ddd (gdb) 中的过去循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2435232/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com