问题描述
set follow-fork-mode child
它报告与之合作
show follow-fork-mode
但实际上不起作用:观察到的fork
的返回值为正PID。
gdb
会话记录
(gdb) file a.out
Reading symbols from a.out...done.
(gdb) b 159
Breakpoint 1 at 0x11384: file myfile.c,line 159.
(gdb) show follow-fork-mode
Debugger response to a program call of fork or vfork is "child".
(gdb) r
Starting program: MYPATH/a.out
Reading /lib/ld-linux-armhf.so.3 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib/ld-linux-armhf.so.3 from remote target...
Reading /lib/ld-2.19.so from remote target...
Reading /lib/.debug/ld-2.19.so from remote target...
Reading /usr/lib/arm-linux-gnueabihf/libarmmem.so from remote target...
Reading /lib/arm-linux-gnueabihf/libc.so.6 from remote target...
Reading /lib/arm-linux-gnueabihf/libc-2.19.so from remote target...
Reading /lib/arm-linux-gnueabihf/.debug/libc-2.19.so from remote target...
Breakpoint 1,main (argc=1,argv=0x7efff7c4) at myfile.c:159
159 mppts_number = index;
(gdb) n
163 pid = fork();
(gdb) n
164 if (pid == -1)
(gdb) p pid
$1 = 10459
(gdb) disconnect
Ending remote debugging.
由于pid
变量包含某些内容,这意味着我们仍在父级中。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)