LINUX study Note 7 -- use the GDB program debugging tool
Source: Internet
Author: User
I. GDB program debugging: program debugging tool 1. function: a) start the program to be debugged B) stop the program at the specified position c) when the program is stopped, check the program status 2. use: a) compile the program gcc with a debuggable Tool & amp; ndash; gb) to start gdb: g... i. GDB program debugging: a program debugging tool
1. functions:
A) start the program to be debugged
B) stop the program to be debugged at the specified position.
C) when the program is stopped, you can check the program status.
2. use:
A) compile the program gcc with the debugable tool-g
B) start gdb: gdb program name
1. Method 2: Start gdb first, and then run the file name
C) check the program: list (l): 10 rows and 10 rows
D) set a breakpoint at main: B main
1. break (B) function name:
2. B row number:
3. B File name: row number
4. B row number if condition
5. View all breakpoints: info break
6. delete a breakpoint: The delete breakpoint number.
E) run gdb: run (r ):
F) one-step operation: next: Do not enter the Subfunction
1. View variable value: print variable name
G) one-step operation: step: Enter the sub-function
H) continue running: continue (c)
I) fully run: run the function finish until the current function ends.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service