当前位置:网站首页>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
边栏推荐
- SQL sorts according to the specified content
- 线程和进程的关系和区别是什么
- 安装pyshp库
- 10.Advance Next Round
- 从源代码到可执行文件的过程
- MySQL groups are sorted by a field, and the first value is taken
- Rust:如何 match 匹配 String 字符串?
- Cf6d lizards and fundamentals 2 problem solving
- LockSupport. Park and unpark, wait and notify
- 实现一个计算m~n(m<n)之间所有整数的和的简单函数
猜你喜欢
SQL -- data filtering and grouping
Kalman filter and inertial integrated navigation
Definition of C class and method
Gesture recognition research
Explanation of login page
Import of data
Explanation of the second I interval of 2020 Niuke summer multi school training camp
定位器
安装pyshp库
Understanding and installing MySQL
随机推荐
Failure to deliver XID in Seata distributed transaction project
Collections multiple parameter sorting
基于pygame库编写的五子棋游戏
Introduction to virtualization features
爬取手游网站游戏详情和评论(MQ+多线程)
Robocode教程5——Enemy类
[leetcode 290] word rules
LockSupport. Park and unpark, wait and notify
深拷贝和浅拷贝的区别
scikit-learn sklearn 0.18 官方文档中文版
定位器
安装pyshp库
Cf515b drazil and his happy friends
Flask - 中间件
Kalman filter and inertial integrated navigation
Object转Json差异之Gson fastJson jackson 修改字段名
Linux 用rpm的方式安装mysql(超简单)
队列解决约瑟夫问题
NVIDIA Jetson: GStreamer 和 openMAX(gst-omx) 插件
Addition, deletion, query and modification of data