如何在gdb中存储调用expr的返回值?例如:
(gdb) call rbt_next(&some_global,0x0)
$2 = (rbt_node *) 0x7169ee00
rbt_next 返回指针下一个节点。但是,当我尝试这样做时:
(gdb) set $w_sess = call rbt_next(&some_global,0x0)
Error: No symbol "call" in current context
我收到上述错误。
我之所以想要这个,是因为我需要遍历全局 rb 树才能找到匹配项。我想要完成的是:-
while $w_sess = call rbt_next($some_global, $c_sess) != 0x0
if $c_sess == $w_sess
printf "Sess found in tree\n"
else
printf "Sess not found\n"
end
end