Domanda

I am debugging a rather large method with spaghetti conditional branching and have a break point set at a specific point. Please note I am not interested in the call stack but rather which if/else branches were hit within the method call leading to the break point.

Is this possible to trace once the break point has been hit in Visual Studio 2010?

È stato utile?

Soluzione

You can track these using tracepoints. Set one up in each of the branches you are interested in and have it output something to indicate which branch you are in. Once you hit the breakpoint you will have the output from each branch it took.

Alternatively, you can do this just using breakpoints by setting one in each branch. You can set the hit count high so that it will not pause at the breakpoint during execution. Then when you get to the breakpoint you are interested in, simply go back over these "dummy" breakpoints and examine the hitcounts.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top