Using C# in Visual Studio 2008 and stepping through a function in the debugger I get to the end of a function and am on the final curly brace } and about to return. Is there a way to find out what value the function is about to return?
This is necessary if the return value is calculated such as:
return (x.Func() > y.Func());
It's a little low level, but if you switch to disassembly then you can single step through the instructions and see what the return value is being set to. It is typically set in the @eax register.
You can place a breakpoint on the ret instructions and inspect the register at that point if you don't want to single step through it.
You can put
(x.Func() > y.Func())
in a watch window to evaluate it, and see the result. Unless the statement is
return ValueChangesAfterEveryCall();
you should be fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With