Gcc-g-wall-o Hello hello.c when debugging
GDB Hello-tui
-G: Generate Debug information
-wall: Compiler warning message
-W: Warning message
When GDB is called, the command line specifies-tui, or ctrl+x+a is used in non-TUI mode.
TUI mode: Upper half source, bottom half input gdb command
Break main: The first line of the main function executable code set breakpoints
Break N: Set breakpoint on nth line
Break if condition: conditional breakpoint, meets condition to pause
Break +offset/-offset: Sets a breakpoint before or after the currently selected stack is executing a line of code
Break *address: Set breakpoints at virtual memory address (e.g. source code or shared library not found)
Clear N: Delete N-line Breakpoint
Clear List_insert: Delete all breakpoints for a function
Clear List.c:list_delet: Delete file: All breakpoints for function
Delete 1 3 4: Delete Breakpoint 1 3 4
Delete 1-4: Delete breakpoints 1 to 4
Disable N: Disabling breakpoints
Enable 1 5: Breakpoint 1 5 Enabled
Enable once 3: Temporarily turn on breakpoint 3
Info break: List all breakpoints
Run: Run Program
Run 12 5 6: Pass Parameters 12, 5, 6 to the program
Next: Travel to the next line
Continue: Resuming execution
Tbreak: Create a breakpoint with a valid number of 1
Until: Get out of the loop and stop.
Finish: Run through the program
Print I: Output i
Watch Z: Monitor Z
Watch (z>5): Find the first position where the z-value is greater than 5 during the execution of a program
Stack frame: The runtime information associated with the call is stored in the memory area that is the stack frame, with the value of the function local variable, the function parameter, and the record that called the function location. Each time a function call is made to create a new frame, the function exits when the frame pops out of the stack and releases.
BackTrace: Displays the entire stack, which is the current collection of all frames
Frame N: The current execution function is numbered 0, the frame is 1, and so on
Up: Bring the next frame to the call stack
Down: In the opposite direction of up
GDB Basic Debugging