views:

63

answers:

1

Is there a similar functionality like the step out of a function to step out of a loop?

I am currently using VS2005, but am interested to know whether MS presented the option in any of the versions.

A: 

No, there isn't such functionality in any version of VS.Net to date. Setting a breakpoint after the loop or using 'Run to cursor' are both reasonable workarounds.

Will A
Assuming there's no 'return' or 'goto' somewhere in the loop body..
Ofek Shilon
"Reasonable" is in the eye of the beholder. I was looking for a solution that would involve 2 keystrokes like `shift`+`F11`
Shaihi
@Ofek - very true - which is most likely why there's no shift+F11 equivalent for loops - the debugger would have to either figure out all possible places you can end up after the loop or single-step repeatedly until the loop is left.
Will A
@Will A - Regarding the return part at least I don't think the debugger needs to perform any differently than in the function case since it needs to perform the code anyhow and it might hit a debugcheck during the execution of the function.
Shaihi
"Run to cursor" solves it with 1 mouseclick and Ctrl+F10 , it's reasonable simple
nos
@Shaihi - If the beholder thinks it is reasonable to write a macro or add-in to solve this then the beholder is either spending way to much quality time with his debugger or needs glasses to see the beauty of the most pragmatic solution. Cheers
Berryl
@Berry -I'm not loosing sleep over it;)@nos - I missed the run to cursor in the answer - I will check it out. thx
Shaihi