当前位置:网站首页>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
边栏推荐
- Version mismatch between installed deeply lib and the required one by the script
- 报错Output image is bigger(1228800B) than maximum frame size specified in properties(1048576B)
- 1493. 删掉一个元素以后全为 1 的最长子数组
- Openstack explanation (24) -- registration of neutron service
- [ERP system] how much do you know about the professional and technical evaluation?
- Exclusive interview - dialogue on open source Zhai Jia: excellent open source projects should be seen by more people. I am honored to participate in them
- P4147 "jade toad Palace"
- 报错[error] input tesnor exceeds available data range [NeuralNetwork(3)] [error] Input tensor ‘0‘ (0)
- keyboard entry.
- JS foundation -- about DOM
猜你喜欢
![[ROS] noedic moveit installation and UR5 model import](/img/bc/865c752021a4ee68e963c09f5f632d.png)
[ROS] noedic moveit installation and UR5 model import

Thread theory

Machine learning notes - convolutional neural network memo list

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

MSF adds back door to normal program

Talk about how to customize data desensitization

Detailed explanation of the difference between construction method and method

ESP8266_MQTT协议

Sed explanation of shell script (SED command, sed -e, sed s/ new / old /...)

报错RuntimeError: BlobReader error: The version of imported blob doesn‘t match graph_transformer
随机推荐
OpenSSL usage
关于原型及原型链
1400. construct K palindrome strings
A summary of the problem type and method for proving the limit of sequence in postgraduate entrance examination
Flask (III) -- variable rules
ESP8266_通过MQTT协议连接阿里云
New feature in ES6 -- arrow function
Method (common method), method execution memory analysis, method overloading mechanism, method recursion
Use of MSF evaluation module
P4147 "jade toad Palace"
POJ3250「Bad Hair Day」
报错Version mismatch between installed depthai lib and the required one by the scrip.
Bucket sort
The first TOF related data set available for deep learning: deep learning for confidence information in stereo and TOF data fusion (iccv 2017)
Analysis of Kube scheduler disk scheduling source code
Opencv image basic operation (IV) -- image feature extraction (corner detection)
Opencv CEO teaches you to use oak (V): anti deception face recognition system based on oak-d and depthai
ESP8266_MQTT协议
报错[DetectionNetwork(1)][warning]Network compiled for 6 shaves,maximum available 10,compiling for 5 s
Clothing ERP: how do enterprises carry out implementation planning?