Author Topic: Debugger doesnt show me global variables  (Read 4784 times)

global

  • Guest
Debugger doesnt show me global variables
« 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debugger doesnt show me global variables
« Reply #1 on: February 15, 2016, 09:06:58 pm »
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!]