About GDB Common commands

Source: Internet
Author: User

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

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.