News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Debugger doesnt show me global variables

Started by global, February 15, 2016, 01:56:00 PM

Previous topic - Next topic

global

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:
#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.

oBFusCATed

Just add 'a' as watch, not the whole expression.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]