在Visual studio中使用跟踪断点
来源:互联网 发布:钢管租赁计算软件 编辑:程序博客网 时间:2024/04/30 04:09
https://blogs.msdn.microsoft.com/visualstudioalm/2013/10/10/tracepoints/
This blog post is part of a series on breakpoints in the Visual Studio debugger and has been updated to reflect the experience of using Visual Studio 2015. If you are interested in details about setting tracepoints using earlier versions of Visual Studio please see theMSDN documentation.
What is a tracepoint? It is a point in the application that allows the developer to perform some action, like logging a message to the output window, and then have the option to continue execution of the program, so it does not have to break at that point during debugging.
To first illustrate how tracepoints are used, we will look at the GCD function in ourmanaged sample. Let’s say we wanted to see all of the steps in calculating the GCD, but we didn’t want to have to stop the program at every iteration.
To get started, first create a breakpoint in the GCD function, and then hover over the breakpoint to bring up the breakpoint’s toolbar and click the “Settings…” icon.
You can also right-click on the breakpoint to bring up the context menu, and select “Actions…”
This will bring up the Breakpoint Settings window. Select “Actions” and “Continue execution”. In the message field you can include custom text, variables, and expressions. (Tip: Using the context menu will open the window with the Actions box already checked.)
You can include the value of a variable or other expression by placing it in curly braces. (To insert a curly brace or backslash into your message as text use “\{“ or “\\” respectively).
There are also many pseudo variables available to output for tracepoint messages. The following special keywords will be replaced with their current
values when the tracepoint is reached during debugging.
Pseudo Variable:
Description:
$ADDRESS
Current Instruction
$CALLER
Previous Function Name
$CALLSTACK
Call Stack
$FUNCTION
Current Function Name
$PID
Process Id
$PNAME
Process Name
$TID
Thread Id
$TNAME
Thread Name
You’ll notice that, the breakpoint icon takes on a diamond shape. This indicates that the action is set to continue execution automatically so the program will not stop at that location.
When the program is executed, you can view the results of the tracepoints in the Output Window.
In this way, tracepoints give you a way to print out values without having to make changes to your source code.
Additionally, if you use IntelliTrace, you can view your tracepoints in the Events View and after selecting the event, you can view the output of the tracepoint in the Locals window.
- 在Visual studio中使用跟踪断点
- Visual Studio 2013 中数据断点的使用
- 使用Visual Studio 2010调试断点不起作用?
- Visual Studio 2010下使用API断点!
- 在Visual Studio 2010中使用opencv
- 详解在visual studio中使用git
- 【Visual Studio】在VS2012中使用VSXtra
- 在Visual Studio 2013 中使用WTL
- 在Visual Studio中使用Git
- 在 Visual Studio 中使用 CUDA
- 在 Visual Studio 中使用正则表达式
- 在Visual Studio中使用psmoveapi
- 在Visual Studio中使用Beyond Compare
- 在Visual Studio 2015中使用Git
- 在Visual Studio 2015中使用TortoiseGit
- 在 Visual Studio Code 中使用Git
- 在visual studio中使用mysql
- 在Visual Studio 2010中使用Visual Leak Detector
- O2O 行业 IT 系统架构实践分享——预告
- IP、子网掩码、缺省网关/默认网关、DNS、服务器、端口的总结
- hduoj1544(判断连续回文)
- html5背景视频使用总结
- 事件选择WSAEventSelect
- 在Visual studio中使用跟踪断点
- asyncTask基础
- u-boot链接脚本分析
- 陆续更新自己在南阳OJ刷题过程,以及蓝桥杯的训练
- mysql行转列(根据列明转换,列不能过多)
- Myeclipse设置jar文件的源代码
- String Stringbuffer StringBuilder 的区别
- leetcode----DP----Maximal Square
- 最新的ssh整合最新版,spring4.2和stuts2.3及hibernate4.2