这是一个普遍的问题。 我试过寻找帮助,但这是关于gdp调试器。 我编译一个程序,它需要两个字符串作为参数。
我用r和它后面的两个参数运行它,但是当我插入像'break 33'这样的休息并在第33行中断然后再次运行它时,我无法进入它并且它不会停留在我的打破。 我不能继续突破等等。
gcc -g -o debugme debugme.c
Directory: /home/
Tue Oct 6 20:03:14 EDT 2015
[]$ debugme "hi there" "bye bye"
String '0' - 'debugme'
String '1' - 'hi there'
String '2' - 'bye bye'
Total number of command-line arguments: 2
(gdb)
Tue Oct 6 20:06:56 EDT 2015
[]$ cd cosc220
[]$ gdb debugme
GNU gdb (GDB; openSUSE 13.1) 7.6.50.20130731-cvs
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
..
Reading symbols from /home/...done.
(gdb) break 33
Breakpoint 1 at 0x4005c7: file debugme.c, line 33.
(gdb) delete 1
(gdb)
(gdb) break 33
Breakpoint 2 at 0x4005c7: file debugme.c, line 33.
(gdb)
我需要输入什么才能使用? 它告诉我我的程序没有运行,我尝试查看我的调用堆栈,它是空的 我输入r以便稍后运行(我刚才没有把它包括在内)
答案 0 :(得分:1)
您需要在gdb上按r,以便程序再次开始运行。
答案 1 :(得分:0)
答案 2 :(得分:0)
事实证明我们学校的服务器上没有安装它... 面掌,它现在正在运作。