Using Eclipse, when debugging is it possible to change the value of variables during runtime of a project for testing purposes.
For example, say I have a method that returns the number 5 but for testing purposes i want to output 10 instead. This isn't the problem I'm facing its a little more complex but its just to get my idea across.
Can you change the value of a variable while debugging a C# application? Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.
How to do this.. double click on the pencil button which is beside the field value, now the field becomes editable, change the field value and hit the Enter key.
Changing a Variable's Value To set a variable go to the Variables view and select the variable you want to change. Right click on the variable and select Change Value... Once you have change the value click ok. The variable now has a new value.
You should be able to set a break-point, go into debug mode, open the variables views and here change the content of the variables.
You can access variables through the Variables view. There you can right click on any variable and select "Change value ...".
Resources :
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