2016-11-08 128 views
0

在gdb脚本中继续等效什么? 我试过使用loop_continue,但没有奏效。 Gdb抛出错误说未定义的命令。gdb脚本重启继续while循环

我想是这样

while $thr 
    if $thr->procedureId != 28 
     set $thr = $thr->cnext 
     loop_continue; // this doesn't work 
    end 
    print $thr 
    set $thr = $thr->cnext 
    end 

回答

1

这里的问题,令人惊讶的,是;。对我来说,这导致gdb说:

未定义的命令:“loop_continue”。尝试“帮助”。

但是,如果我离开了;,它的工作原理:

(gdb) set $x = 0 
(gdb) while $x < 5 
>if $x < 3 
    >set $x = 72 
    >loop_continue 
    >end 
>end 
(gdb) print $x 
$1 = 72