Code::Blocks Forums

User forums => Help => Topic started by: global on February 15, 2016, 01:56:00 pm

Title: Debugger doesnt show me global variables
Post by: global on February 15, 2016, 01:56:00 pm
hi,
I have codeblocks on windows 10/64bit and compile c-code with "gnu gcc compiler".

When I debug my programs and I want to know how the values of the variables change, watches only show me the local variables, but no global variables.

For example in this program:
Code
#include <stdio.h>

int a=3;

int main()
{
    printf("test");
    return 0;
}

When I debug it, select the line "int a=3", make rightclick on it and click on "Watch int a=3;" I get this message in the watches window:
A syntax error in expression, near `a=3;'.

This happens with every global variable.

And also when I have in a function/procedure an array as an argument, it doesnt show me the values of the array, it seems to just show me the memory adress.

Can someone help?
thanks.
Title: Re: Debugger doesnt show me global variables
Post by: oBFusCATed on February 15, 2016, 09:06:58 pm
Just add 'a' as watch, not the whole expression.