赞
踩
这个没有捕获到断点的原因是,可能是多线程的问题,需要设置:
set detach-on-fork off
On Linux, if you want to debug both the parent and child processes, use the command:
set detach-on-fork on/off
on 默认设置,gdb会放弃子线程(或者父线程,受follow-fork-mode的控制)的监控。
off gdb会同时监控父线程及子线程。在调试一个线程的时候,另一个也会暂停。
如果您选择“detach-on-fork=off”,则 gdb 将保留对所有子线程(包括嵌套子线程)的控制。您可以使用 info inferiors 命令列出 gdb 控制下的子进程,并使用 inferior 命令从一个子线程切换到另一个子线程。
To quit debugging one of the forked processes, you can either detach from it by using the detach inferiors command (allowing it to run independently), or kill it using the kill inferiors command.
If you ask to debug a child process and a vfork is followed by an exec, gdb executes the new target up to the first breakpoint in the new target. If you have a breakpoint set on main in your original program, the breakpoint will also be set on the child process’s main.
On some
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。