以下描述摘自《专业Visual Studio 2017》一书:
...当运行到光标处时,命中了一个不同的断点,然后 那么执行仍然会停在你的光标处run tocursor这是否意味着“
”命令可以在到达光标之前跳过断点(而不是在断点处停止)?
Run to cursor
会在光标位置设置一个临时断点(请参阅
MS 文档),一旦命中就会将其删除。 因此,如果您在光标位置之前遇到断点,则执行将暂停(就像在断点上一样)。一旦你继续,临时断点(在你的光标位置)将会被击中。
1 void Example()
2 {
3 var something = new Something(); // break point 1
4 something.OtherThing(); // cursor position
5 something.AnotherThing(); // break point 2
6 }
在此示例中,如果您使用
Run to cursor
,将按以下顺序命中断点:
3号线