当前位置:网站首页>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
边栏推荐
- 报错RuntimeError: BlobReader error: The version of imported blob doesn‘t match graph_transformer
- Technical practice of dolphin dispatching in kubernetes system
- JS foundation -- Date object
- Events in JS
- Day44 database
- Output image is bigger (1228800b) than maximum frame size specified in properties (1048576b)
- Runtimeerror: blobreader error:the version of imported blob doesn't match graph_ transformer
- Modularnotfounderror: no module named 'find_ version’
- The first TOF related data set available for deep learning: deep learning for confidence information in stereo and TOF data fusion (iccv 2017)
- Design of wrist sphygmomanometer based on sic32f911ret6
猜你喜欢

Day41 process pool and thread pool

MSF SMB based information collection

Analysis of high frequency interview questions in massive data processing

我们是如何连上WiFi的?

js基础--关于DOM

Openstack explanation (24) -- registration of neutron service

Day39 process object and other method mutexes

ESP8266_MQTT协议

Type-C Bluetooth speaker single port rechargeable OTG solution

Type-C扩展坞自适应供电专利维权案例
随机推荐
ESP8266_ SmartConfig
[scheme development] scheme of infrared thermometer
【分享】企業如何進行施行規劃?
js基础--Array对象
Type-C蓝牙音箱单口可充可OTG方案
What problems can ERP system help enterprises deal with?
Day44 database
Zhiyun health submitted the statement to HKEx again: the loss in 2021 exceeded 4billion yuan, an increase of 43% year-on-year
Day39 process object and other method mutexes
ESP8266_SmartConfig
Where is it safer to open an account for soda ash futures? How much does it cost to buy at least one hand?
How do we connect to WiFi?
1493. the longest subarray with all 1 after deleting an element
Opencv image basic operation (IV) -- image feature extraction (corner detection)
Design of wrist sphygmomanometer based on sic32f911ret6
Detailed explanation of this and static
Suffix Array
Do you know these advantages of ERP system?
Monotone stack
报错Version mismatch between installed depthai lib and the required one by the scrip.