Some basic operations of GDB debugging

Source: Internet
Author: User

1.g++-G filename (generates a.out debug program)


2.gdb a.out (enter the Debug interface)


3.b+ line number (the file that contains the main function by default); B+filename: Line number (the breakpoint is set in the specified file).


4.info + b (see all breakpoints)


5.D + num (Info b Gets the breakpoint number num), and the delete breakpoint number is Num's breakpoint.


6.P + variable name (print variable value)


7.display + variable name (tracking variable, but the valid range of the variable is invalidated)


8.N Next


9.s entering function body


10.U + line number (debug jumps to selected line)


11.BT (View program Call information)


12.refresh (Use the most, can generate a standard graphical interface, all of your operations can be clearly presented)


13.GDB debugging graphical interface in my blog has introduced, similar to VC inside the debugger, powerful features.


14.Q (Exit GdB)

Some basic operations of GDB debugging

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.