Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change a variable value on conditional breakpoint in visual studio 2015

Is there any way to change value of variable to on a conditional breakpoint and continue execution.

My code is like this

switch(var){ //conditional breakpoint on this line
    case 1:
    break;
...
}

I put conditional breakpoint like below (var == 0 ) || (var ==1) is true

So when this breakpoint hits, I want to change var = 2, and continue execution.

What I found: I found Action also, but it only log messages. Is there any way to executing a statement like var = 2 as Action taken on this conditional breakpoint.

I don't want to change code because building it takes hell lot of time.

Note: I am working C++ on Visual studio 2015

like image 371
ashish Avatar asked Jul 26 '16 11:07

ashish


People also ask

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

yes ,it is possible to change the value of a variable while debugging in a c# application .

How do you break a variable change in Visual Studio?

Setting a data breakpoint is as easy as right-clicking on the property you're interested in watching inside the watch, autos, or locals window and selecting “Break when value changes” in the context menu. All data breakpoints are displayed in the Breakpoints window.


1 Answers

In Log a message to Output Window write {my_variable=12345} the side effect of log output is assigning 12345 to my_variable.

Take into account that Log a message can accept and evaluate complex expressions in curly braces.

like image 127
Anton Plakhotnyk Avatar answered Oct 05 '22 22:10

Anton Plakhotnyk