gpt4 book ai didi

Perl 调试器 - 如何跳出循环

转载 作者:行者123 更新时间:2023-12-01 08:35:33 32 4
gpt4 key购买 nike

在使用 perl 调试器时,有没有办法跳出当前循环?

例如:

line 1
for($i=1;$i<100000:$i++)
{
line2
}
line3

我希望调试器跳出这个 for 循环并在第 3 行停止

最佳答案

c 5

演示:

>perl -d

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `perldoc perldebug' for more help.

print "line1\n";
for (1..100000) {
print "line2\n";
}
print "line3\n";
^Z
main::(-:1): print "line1\n";

DB<1> s
line1
main::(-:2): for (1..100000) {

DB<1> s
main::(-:3): print "line2\n";

DB<1> s
line2
main::(-:3): print "line2\n";

DB<1> c 5
line2
line2
line2
...
line2
line2
line2
main::(-:5): print "line3\n";

DB<2> s
line3
Debugged program terminated. Use q to quit or R to restart,

关于Perl 调试器 - 如何跳出循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11173140/

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