我正在用gdb进行组装调试,以进行学校作业。问题在于该程序在gdb中仅运行一次。之后,无论何时尝试,它都只会打印“程序在5秒后超时”,并且不会再次运行。
所以我要做的是一次又一次地运行~/Desktop/lab/ $ gdb filename
> (gdb) run
>(调试)> (gdb) quit
>运行gdb filename
。这使我花了两倍的时间,使我非常烦恼。 gdb最初运行一次吗?还是有办法解决?请帮助我。
谢谢。
(gdb) run -u 2014-14459 //the program runs for the first time
Starting program: /home/devel/Desktop/lab/seokyoung-kook/buflab-handout/bufbomb -u 2014-14459
Userid: 2014-14459
Cookie: 0x3beba64f
Breakpoint 1, 0x08048db0 in getbuf ()
(gdb) s
Single stepping until exit from function getbuf,
which has no line number information.
Program timed out after 5 seconds
Type string:[Inferior 1 (process 2794) exited with code 01]
(gdb) s
The program is not being run.
(gdb) s
The program is not being run.
(gdb) run -u 2014-14459 //second try
Starting program: /home/devel/Desktop/lab/seokyoung-kook/buflab-handout/bufbomb -u 2014-14459
Userid: 2014-14459
Cookie: 0x3beba64f
Program timed out after 5 seconds //not running
Type string:[Inferior 1 (process 2797) exited with code 01]
(gdb) run -u 2014-14459 //third try
Starting program: /home/devel/Desktop/lab/seokyoung-kook/buflab-handout/bufbomb -u 2014-14459
Userid: 2014-14459
Cookie: 0x3beba64f
Program timed out after 5 seconds //not running
Type string:[Inferior 1 (process 2798) exited with code 01]
(gdb) s
The program is not being run.