When I’m debugging, I often have to deal with methods that does not use an intermediate variable to store the return value :
private int myMethod_1() { return 12; } private int myMethod_2() { return someCall( someValue ); }
Well, in order to recreate a bug, I often have to change values on the fly. Here, I could want to see what happens when myMethode_1 return zero. Same thing for myMethod_2.
Is there a way to do that without modifying the code ? What I would like to do, it’s to place a breakpoint on the return line (or on the closing bracket) and type-in a new return value.
Note : I’m using Visual Studio 2005 and Visual Studio 2008.
Thank !
For those who are looking for a solution to this in VB.NET:
It was so simple, I can’t believe I did not see it : To look at the value a function will return : just place the pointer over the function’s name. The value will be shown in a tool tip.
The change the value : just click on this tool tip, change the value and hit enter.
Visual Studio is very cool !
Note : I tested it in VB.NET on Visual Studio Team System 2008. Just tried using C#, but it does not work… 🙁