I like how开发者_StackOverflow you can capture breakpoints as Intellitrace events. Breakpoints are easy to add/enable/disable, and can be added/removed at runtime (as opposed to say Console events).
However, of course breakpoints stop the flow of execution, and I have to press F5 F5 F5 F5 F5 F5 constantly while I debug the running application. I'd love to be able to capture breakpoint events in intellitrace and just let the code execute without actually breaking on the breakpoints.
I've also used Console statements as captured intellitrace events, but breakpoints are much easier to add (F9 as opposed to pasting a Console.WriteLine("...")
everywhere), and I can add and disable new breakpoints at runtime, whereas if I want to add or remove a Console based event at runtime, I have to stop the program, add/delete, and restart.
Are there any good ways to capture intellitrace events in this way?
I think this is what you are looking for:
http://geekswithblogs.net/sdorman/archive/2009/02/14/visual-studio-2008-debugging-tricks-ndash-advanced-breakpoints.aspx
Basically, you can use an advanced breakpoint to do a number of different things. In your case, you would probably want to use the tracepoint that simply gives a hit count. In other cases, you might want to specify that the breakpoint only occurs after a certain number of hits (maybe you want to be sure a loop isn't infinite).
Visual Studio has a ton of great features inside of the breakpoint option. I'm sure that even if the above option didn't solve your problem that there is still something that is included in the above article that will solve your problem.
精彩评论