1. Start the Debug program
GDB debugging objects, such as the GDB app
2. Running the program
Run or this abbreviation is R
3. Set Breakpoints
There are several different ways
1) Break Line
2) Break File:line
3) Break Function:offset
4. Continue execution after interruption
C
5. Display assembly code
Disassemble or abbreviated to Disas
Combining different parameters to achieve different display effects, several classic usages
Disas/m Func1--Compilation of display function func1
Disas $pc, +10--Shows the 10-byte assembly starting at the PC location
6. Display memory contents
X/nfu BUF
n indicates the number of memory units to display
F represents the display mode, preferably the following values, such as X-16 binary, D-by decimal
U represents the length of an address unit, B-byte, H-double word, w-4 Word, g-8 Word
7. Single Step execution
Next executes a code NEXTI executes a machine instruction step and Stepi similar to next and Nexti, just enter the Sub function 8, display stack BT
About GDB Common commands