The difference between Step,next and finish in GDB

Source: Internet
Author: User

Step is stepping, encountering the child function to enter and continue stepping; in other debugs it is equivalent to the Step-into command, which is the function of moving to the next executable line of code. If the current row is a function call, the debugger enters the function and stops the first line in the body of the function. Step can help uncover the mysteries of the code location, such as: function calls and functions themselves may be in different files.


Next is when you step into the function, when you encounter a child function inside a child function is not stepping into the sub-functions, but the child function is completed and then stop, that is, the whole function as a step. The equivalent of step-over in other debuggers is to move to the next executable line of code at the same call stack level. The debugger does not enter the function body. If the current row is the last line of the function, next will go to the next stack and stop at the next line of the calling function.


Finish is but when stepping into a child function, you can execute the remainder of the child function with step out and return to the previous layer function. The equivalent of step-out in other debuggers is to advance to the next level in the stack and stop at the next line of the calling function.

Reference: http://blog.sina.com.cn/s/blog_74d0ff140101dfv6.html

The difference between Step,next and finish in GDB

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.