If I have a code like this
void testFun()
{
int result = add(a, b);
}
The value of ‘result’ cannot be watched when debugging. the qt creator hint me , that the variable ‘result’ is out of scopt when the program run to the end of this function. Consider this situation, I have to add a meaningless sentence to keep the ‘result’ still in scope and watch the ‘result’ value. Is this gdb problem or qt creator. How can I resolve it? The same code in msvc, I can see the ‘result’ value no doubt. This is not convinient for debugg.
↧