vs2015--mapping methods on the call stack when debugging in Visual Studio

Source: Internet
Author: User

Https://msdn.microsoft.com/zh-cn/library/dn194476.aspx

Mapping methods on the call stack when debugging in Visual Studio

Create a code map to visually track the call stack when debugging. You can annotate in the diagram to keep track of what the code is doing to focus on finding bugs.

generate call stack diagram
1 start Debugging. (Keyboard: "F5")
2 After your app enters break mode or you step into a function, select Code map. (keyboard: Ctrl + Shift + ')

The current call stack appears orange on the new Code map:

Labeling Your code
Add comments to track what happens to your code. To add a new line to the note, press Shift + Return

Update diagram with Next Call stack
Run your app to the next breakpoint or step into a function. This diagram adds a new call stack

Add related code to the diagram
Now that you have generated a diagram, what do you do next? If you are using Visual C #. NET or Visual Basic. NET, add items such as fields, properties, and other methods to track what happens to your code.
Double-click a method to view its code definition, or use the shortcut menu for the method. (Keyboard: Select the method on the diagram and press F12)

Using graphs to find bugs
With code visualization, you can help you find bugs faster. For example, suppose you are investigating a Bug in a drawing program. When you draw a line and try to undo the action, the change will not occur until you draw another line.
Therefore, you can set breakpoints in the clear, undo, and Repaint methods, start debugging, and then generate a diagram like the following:

vs2015--mapping methods on the call stack when debugging in Visual Studio

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.