This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot see local variables

Hi, I'm trying to develope an application with the STM32F4-Discovery Board, but I'm having problems when debugging. I don't know why I cannot see local variables, the y appear always as <not in scope>.

Does anyone knows what's happening?

Parents
  • Please, be more specific.
    Local variables can not be seen (because they do not exist) before you step to the point of their creation. Static variables, on the other hand, have static linkage and exist forever (but they can be seen only in the scope of their function).

    For example:

    
    void foo()
    {
        <some code>; // <-- all static variables from this function are already visible
    
        static int a; // <-- despite the fact they are created on this line
    
        <some code alse>;
    
        int b; // <-- local variable b start its existence only from this line
               // and can be seen only from here
    }
    
    

    If that's the case than it's completely normal.

Reply
  • Please, be more specific.
    Local variables can not be seen (because they do not exist) before you step to the point of their creation. Static variables, on the other hand, have static linkage and exist forever (but they can be seen only in the scope of their function).

    For example:

    
    void foo()
    {
        <some code>; // <-- all static variables from this function are already visible
    
        static int a; // <-- despite the fact they are created on this line
    
        <some code alse>;
    
        int b; // <-- local variable b start its existence only from this line
               // and can be seen only from here
    }
    
    

    If that's the case than it's completely normal.

Children