cancel
Showing results for 
Search instead for 
Did you mean: 

The debugger shows me variable differently from as i declared

FManc.1
Associate II

I declare this two variable globally

uint8_t data_rcv_flg[1] = { 0 }; /* To avoid reuse of data */
uint8_t run[1] = { 0 }; 

I use this variable here:

MODEM_ConfigTypeDef modem_cfg;
modem_cfg.buff = data;
modem_cfg.rcv_flag = data_rcv_flg;
 
PROTOCOL_ConfigTypeDef protocol_cfg;
protocol_cfg.run = run;

where in the typedef are declared as uint8_t *.

The variables are exactly the same but the debugger show me this:

0693W000006I6HDQA0.pngI can't understand why this behaviour.

Can someone explain me?

6 REPLIES 6
Uwe Bonnes
Principal III

The debugger shows you a variable "pointer to uint8_t". You have to derefernece the pointer to get to the data.

FManc.1
Associate II

The same identical code but with "run" renamed to "protocol_run" now works.

I can't explain why.

And the same variable declaration in a empty project, with name "run", works.

It's possible that there is a name conflict?

Uwe Bonnes
Principal III

It is up to the preprocessor /compiler to find thos conflicts. It would be strange if there are conflicts but no warning.

No idea of What could cause this error?

Have a look into the mapfile, how does the linker locate those variables.

JW