Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing variables in realtime when debugging in eclipse?

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.

like image 859
Julio Avatar asked Sep 23 '10 12:09

Julio


People also ask

Is it possible to change the value of a variable while debugging?

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 do I change the value of a variable in debug mode in SAP?

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.

How do I change the value of a variable in Eclipse?

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.


2 Answers

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.

enter image description here

like image 63
aioobe Avatar answered Oct 11 '22 08:10

aioobe


You can access variables through the Variables view. There you can right click on any variable and select "Change value ...".


Resources :

  • standford.edu - eclipse guide
  • help.eclipse.org - change var value
like image 41
Colin Hebert Avatar answered Oct 11 '22 08:10

Colin Hebert