调试Q与GDB调试器
Debug Q With GDB Debugger
这是一个很普遍的问题。我试着四处寻找帮助,但它是关于gdp调试器。我编译了一个程序,它接受两个字符串作为参数。
我用r和它后面的两个参数运行它,但是当我插入一个像' break 33 '这样的断行,并在第33行断行,然后再次运行它时,我不能进入它,它不会在我的断行处停止。我不能step break继续等等
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以便稍后运行(我只是没有在这里包含它)
您需要在gdb中按r,以便您的程序再次开始运行。
我需要输入什么才能使它工作?
你应该读一篇介绍,比如这篇。
您正在寻找的命令是run
,但是一旦您将程序运行到断点,可能会有更多的问题,因此从介绍开始可能仍然是一个好主意。
原来我们学校的服务器上没有安装…Face-palm,现在起作用了
相关文章:
- 正在VS调试器中监视映射条目
- 为什么我的 VS 代码调试器在我的C++代码周围弹跳?
- 带有 GDB 调试器的 VS 代码内存视图
- 使用 Windows 10 和 MINGW 编译器在 VS Code 上使用 gdb 调试器进行调试时出错
- 为什么我的程序无法在GDB在线编译器/调试器或Visual Studio C++ 2019中运行
- 标识gdb调试器中符号的源文件名
- 为什么GDB(或任何调试器)逐步进入标题
- GDB 调试器访问未找到的文件
- "gdb"调试器奇怪地跳过断点
- 将 GDB 或 LLDB 嵌入程序C++并从代码启动调试器
- Gdb 在崇高的文本 3:调试器不会在断点处停止并立即退出
- 使用 Linux Eclipse,我可以以编程方式判断我正在调试器 (gdb) 中执行
- 代码精简版调试器错误:无法找到 gdb!在'/usr/bin/gdb'
- 山狮没有工作的 gdb 调试器
- 调试Q与GDB调试器
- C++ Eclipse Mars+MinGW 中的调试器"gdb.exe --version"错误
- 提振.测试:如何自动附加调试器(GDB)
- GDB 调试器在代码::块中不起作用
- 如何使用gdb达到与使用可视化调试器相同的效率水平
- GDB调试器挂在std::cout上