score:1

Accepted answer

there is no way of doing that, the debug shell executing just interfere in objects that are currently in the context of the running program.

you can change the values of variables and objects that are currently at runtime, but not define new ones on the debug shell. even if you could do that your new variable will not be anywhere in your code, and if you have it declared, you may have issues declaring the same identifier twice.

if you declare a new variable like in your example ( int c = a + b; ), the c variable will be available only inside your debug shell context.

one workaround to you see the result of the execution is to inspect your expression using the ctrl + shift + i shortcut:

enter image description here


Related Query

More Query from same tag