I’d like to know how to debug the last statement in a method? For example, let’s say I have the following statement method:
private void doSomething()
{
int x = 5;
int y = x + 4;
int z = y * 2;
}
If I but the breakpoint at the start of the method and step trough the method, I can see the result of x, the result of y, but not the result of z, how can I see the result of z while debugging?
EDIT: Apparently this value is being skipped because it isn’t significant to the program but while it might not be significant for the final program but it is significant while debugging & testing and highly annoying when I have to add dummy statements for these kind of things.
You can set a breakpoint at the closing bracket
}.zshould be available there. Or you could multiplyyby 2…