VC ++ 6.0-single-step debugging in Release _ VC technical Article _ VC _ Software Programming

Source: Internet
Author: User

On some programming forums, I often see that some people ask me that the program is good under Debug, But it crashes when it reaches Release, or it is good under Release, however, if a problem such as failure occurs under Debug, it is best to solve this problem. As long as you trace it in one step, check its call stack, and the function call sequence, the error will be displayed at a glance. Generally, the error is either an operation on the NULL pointer, or the memory to be released is not as big as it was originally applied for, or the memory to be applied for is called multiple times and so on ......

Therefore, debugging is the first technology to be mastered by programmers. It can be said that no debugging means no programming. VC ++ 6.0 comes with a very good debugging tool, which is very convenient to use. You can start by clicking F5. The single step is F10, and the single step is F11 .. I will not talk much about the debugging technology. There are many things in it. There are several Debug-related windows, including Watch, Variables, and Call Stack.

However, we all know that in the Release mode, single-step debugging is not allowed (in fact, not debugging, but Source Code cannot be tracked) and breakpoint setting, because the program compiled in this way does not contain debugging symbols, we can only get the assembly code when there is an error, but cannot confirm that it is an error in the source code.

How can we achieve single-step and breakpoint in the Release mode? It's easy. Set it as follows:

1. Step 1: Open the Project menu-> Setting..., select the Project to be set, and select "Win32 Release ":

2. Step 2: select the C/C ++ Tab, and then select "Program Database" in Debug Info: list"

3. Step 3: select the Link Tab and select "Generate debug info"

Related Article

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.