GDB usage Record

Source: Internet
Author: User

GDB usage Record

Used to record the methods used for daily debugging, not simple command instructions

Let's start by listing the commands you've used.
Command: Abbreviation: description
RUN:R: Executing the program
BREAK:B: Setting breakpoints
PRINT:P: Print variable contents
Next:n: Executes to the next statement
Step:s: Enter function Execution (GDB is officially said to be step program until it reaches a different source line.)
CONTINUE:C: Continue execution
BACKTRACE:BT: Print Call stack
Frame:f: Displays the current stack information
Finish:: Completes the execution of the current function (the official version of the GDB manual is the execute until selected stack frame returns. The function here is popular)
EXAMINE:X: Print Memory content
Until:u: Complete the current loop (although in many cases this is not the case, the official version of the GDB manual is the execute until the program reaches a source line greater than the present or a spec ified location (same args as Break command) within the current frame.)
Jump:j: Jumps to the specified location to execute

The usual means
1, redirect. Run 0<input.file 1>output.file or set args 0<input.file 1>output.file
2. Repeat the code (within the same function). b line_number \ n J line_number\n
3, print memory. X/8XB address, print 8 bytes in 16-in-A-way

GDB usage Record

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.