1 year ago

#194822

test-img

Rsl nbri

Qt Creator debugger just show local variables

I am using QtCreator5.14.0 MinGW-64bit and I wrote this code :
(do not check the code, it is correct , my problem is another thing)


    #include <iostream>
    using namespace std;
    #define MAX 100
    int Solutions[MAX]={0,1};
    int CountOfCalls = 0;
    long int f(int a){
        if(a==0)
            return 0;
        if(Solutions[a])
            return Solutions[a];
        CountOfCalls++;
        return (Solutions[a] = f(a-1) + f(a-2));
    }
    int main(){
        cout<<f(40)<<endl;
        cout<<"Count of calls : "<<CountOfCalls<<endl;
        return 0;
    }

when I begin debugging at the first code in the main , right pane doesn't show global variables(here is Solutions array and CountOfCalls variable) just shows local variables.

debugging : https://i.imgur.com/YvVvbyk.png
my debugger settings :
General : https://i.imgur.com/Ziz8vHJ.png
GDB : https://i.imgur.com/FdjsGmf.png
GDB Extended : https://i.imgur.com/eJ8Bq4Y.png
Locals & Expressions : https://i.imgur.com/ef4KxSj.png

I can right click and choose add new expression evaluator to have the Solutions array and CountOfCalls variable in the right pane , but it is boring for big source codes to add everything you want .

how to tell debugger to evaluate all global and local variables automatically?

c++

qt

qt5

qt4

qt6

0 Answers

Your Answer

Accepted video resources