当前位置:网站首页>GDB debugger installation and use
GDB debugger installation and use
2022-04-23 06:32:00 【ZhangLH66】
VScode Lack of compiler and debugger, need to use GDB debug
Want to use gdb debug , Add... When compiling the program -g
That is to say
gcc -g main.c -o main
gdb When debugging , Use the Enter key You can repeat the previous command
gdb When there is too much debugging information , Use Ctrl + l You can clear the screen
If you want to see the code while debugging, you can install this tool
terminator
sudo apt-get install terminator
Call tool
terminator
Then right click on the terminal to select the vertical division into two terminals , Then you can debug while using
Get into gdb debugging , Yes -g Executable to compile ( The terminal will be displayed in green )
gdb XXX
#XXX Is the name of the executable
When checking whether the executable file is available for debugging , Directly follow the above command to enter , If the output shows yes
no debugging symbols found....done
It means that the executable file does not contain any debugging information
sign out gdb debugging
quit
gdb Direct operation
run
# It can also be abbreviated as
r
gdb On a line (n) Add a breakpoint
break n
# It can also be abbreviated as
b n
# there n Is the number of lines in a line
View the established breakpoints
info breakpoints
View a variable at a time (i) Value
print i
# It can also be abbreviated as
p i
Always display and output a variable (i) Value
display i
Skip the current breakpoint and continue
continue
# It can also be abbreviated as
c
Check the program code up, down, left and right of the current breakpoint
list
# It can also be abbreviated as
l
版权声明
本文为[ZhangLH66]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210614497970.html
边栏推荐
- gst-launch-1.0用法小记
- 电机与拖动(戚金清版)学习整理
- Rust: Tcp 服务器与客户端的一个简单例子
- 8. Integer Decomposition
- [leetcode 290] word rules
- GNU EFI header file
- 1007 go running (hdu6808) in the fourth game of 2020 Hangzhou Electric Multi school competition
- Rust:单元测试(cargo test )的时候显示 println 的输出信息
- -- SQL query and return limit rows
- Rust 中的 RefCell
猜你喜欢

Storing inherited knowledge in cloud computing

Addition, deletion, modification and query of MySQL table

Detection technology and principle

Substring Inversion (Easy Version)

Installation and usage skills of idea
![[leetcode 54] spiral matrix](/img/c0/9a55a62befb783a5bfc39dc3a96cb2.png)
[leetcode 54] spiral matrix

7-21日错题涉及知识点。

检测技术与原理
![[untitled] database - limit the number of returned rows](/img/20/9a143e6972f1ce2eed5a3d11c3a46d.png)
[untitled] database - limit the number of returned rows

定位器
随机推荐
Rust: Tcp 服务器与客户端的一个简单例子
H. Are You Safe? Convex hull naked problem
程序设计训练
12. Monkeys climb mountains
A solution to replace not in in SQL
C language file operation
[leetcode 150] evaluation of inverse Polish expression
程序設計訓練
Linux 用rpm的方式安装mysql(超简单)
如何安装jsonpath包
Cf6d lizards and fundamentals 2 problem solving
Example of reentrant lock thread waiting to wake up
根据SQL语句查询出的结果集,将其封装为json
破解滑动验证码
6.Reversal
selenium+webdriver+chrome实现百度以图搜图
Common shortcut keys of IDE
Techniques et principes de détection
Completely clean up MySQL win
多线程爬取马可波罗网供应商数据