Pelles C forum

C language => Beginner questions => Topic started by: henrin on November 11, 2009, 10:02:27 PM

Title: Debug with version 6: how to get the value of static variables
Post by: henrin on November 11, 2009, 10:02:27 PM
When debugging with v.5, once halted (step-by-step or beakpoint), if you move the mouse in the source code window, you get the value of variables.

Two folders - local and global - show the variables. Static variables appear in the global folder: that is normal.

But with v.6, I can't get static variables in any way :
- mouse cursor on the variable,
- global or local folder
- watch

What is hapenning ?
Title: Re: Debug with version 6: how to get the value of static variables
Post by: JohnF on November 12, 2009, 08:28:44 AM
Yes it's unfortunate - when debugging you could temporarily make the variable global.

John
Title: Re: Debug with version 6: how to get the value of static variables
Post by: AlexN on November 12, 2009, 08:58:50 AM
Quote from: henrin on November 11, 2009, 10:02:27 PM
When debugging with v.5, once halted (step-by-step or beakpoint), if you move the mouse in the source code window, you get the value of variables.

Two folders - local and global - show the variables. Static variables appear in the global folder: that is normal.

But with v.6, I can't get static variables in any way :
- mouse cursor on the variable,
- global or local folder
- watch

What is hapenning ?

It seems to be a problem from the compiler. If you compile a program with static variables with the v.5 compiler, you can see the static variables also in the v.6 debugger.
If you compile with the v.6 compiler, the only way to find the content of a static variable is to look in disassembly view (right click in the debugger source window and select it) where the variable is stored and look to in the memory view.