Visual Studio--Alter Variable While Debugging -
is possible alter variable while debugging?
say example have code:
string x = "foo"; //would passed-in variable in real world. var y = "x equals " + x; ==>[breakpoint] return x;
is there way manually enter or otherwise change value of "x" when hit break point? , possible "step back" in code in same way can press f11
, step through it?
yes, there 2 ways change variable:
- use immediate window. typing
x = "a new value"
change it. also, if want check value of x use?x
- you can hover on variable, , when value displays in quickwatch pop-up thing, click on manually change it. (you can add variable watch, or select quickwatch change it).
if step different instruction, there 2 ways too:
- you can right-click on line want go , select 'set next statement'. works if have hit exception while debugging
- you can drag yellow arrow indicates current instruction wherever need
Comments
Post a Comment