当前位置:网站首页>GDB debugging common commands
GDB debugging common commands
2022-06-11 09:39:00 【ZBB's notes】
title GDB Debugging steps
Use gdb During debugging , You need to use... At compile time -g Parameters
g++ -g test.cpp -o test
gdb ./test
Title Common Commands :
start # Start debugging , Stop at the first line of code ,(gdb)start
l #list See the source code ,(gdb) l [number/function]
b <lines> #b: Breakpoint Abbreviation , To set breakpoints .(gdb) b 10
b <func> #b: Breakpoint Abbreviation , To set breakpoints .(gdb) b main
b filename:[line/function] #b: In the file filename Set a breakpoint at a line or function of
i breakpoints #i:info Abbreviation .(gdb)i breakpoints
d [bpNO] #d: Delete breakpoint Abbreviation , Delete a breakpoint with a specified number , Or delete all breakpoints . Breakpoint number from 1 Began to increase . (gdb)d 1
s #s: step Execute a line of source code , If there is a function call in this line of code , Enter the function ;(gdb) s
n #n: next Execute a line of source code , The function call in this line of code is also executed .(gdb) n
r #Run Abbreviation , Run the program being debugged . If you haven't hit a breakpoint before , Then execute the entire program ; If there's a breakpoint , The program pauses at the first available breakpoint .(gdb) r
c #Continue Abbreviation , Continue to execute the debugged program , Until the next breakpoint or the end of the program .(gdb) c
finish # End of the function
p [var] #Print Abbreviation , Display the specified variable ( Temporary or global variables for example int a) Value .(gdb) p a
display [var] #display, Set the variable you want to track ( for example int a).(gdb) display a
undisplay [varnum] #undisplay Cancel tracking of variables , The tracked variable is identified by an integer .(gdb) undisplay 1
set args # Runtime parameters can be specified .(gdb)set args 10 20
show args # Look at the runtime parameters .
q #Quit Abbreviation , sign out GDB Debug environment .(gdb) q
help [cmd] #GDB Help order , Provide right GDB Explanation of the name and species command . If you specify “ Command name ” Parameters , The detailed description of the command is displayed ; If no parameter is specified , Then all the GDB command , For users to further browse and query .(gdb)help
enter # Repeat the previous command ,(gdb) enter
————————————————
Copyright notice : This paper is about CSDN Blogger 「Panix2n_n」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/mercy_ps/article/details/81542986
边栏推荐
- [software] ERP model selection method for large enterprises
- Do you know these advantages of ERP system?
- ESP8266_SmartConfig
- ESP8266_SNTP(Simple Network Time Protocol)
- Package details
- Augmented reality experiment IV of Shandong University
- [software] ten skills to maximize the value of ERP system
- Analysis of Kube scheduler disk scheduling source code
- Sed explanation of shell script (SED command, sed -e, sed s/ new / old /...)
- Type-C扩展坞自适应供电专利维权案例
猜你喜欢

Method (common method), method execution memory analysis, method overloading mechanism, method recursion

Bowen dry goods | Apache inlong uses Apache pulsar to create data warehousing

ESP8266_ SmartConfig

ESP8266_通过MQTT协议连接阿里云

Openstack explanation (24) -- registration of neutron service

Opencv CEO teaches you to use oak (IV): create complex pipelines

MSF SMB based information collection

Type-C扩展坞自适应供电专利维权案例

Shandong University project training (IV) -- wechat applet scans web QR code to realize web login

Openstack explanation (XXIII) -- other configurations, database initialization and service startup of neutron
随机推荐
报错Output image is bigger(1228800B) than maximum frame size specified in properties(1048576B)
1493. the longest subarray with all 1 after deleting an element
Fabric.js 动态设置字号大小
Comment l'entreprise planifie - t - elle la mise en oeuvre?
1493. 删掉一个元素以后全为 1 的最长子数组
[software] ERP model selection method for large enterprises
Why is it difficult to implement informatization in manufacturing industry?
PD chip ga670-10 for OTG while charging
Shandong University project training (IV) -- wechat applet scans web QR code to realize web login
js基础--关于DOM
Openstack explanation (XXIII) -- other configurations, database initialization and service startup of neutron
Day41 process pool and thread pool
Flask (IV) -- URL construction
1854. 人口最多的年份
Simulation of map and set
ESP8266_ SmartConfig
考研数学 【数列极限证明题】题型方法总结
Fabric.js 動態設置字號大小
Do you know these advantages of ERP system?
ESP8266_SmartConfig