Skip to main content
FManc.1
Associate II
January 9, 2021
Question

The debugger shows me variable differently from as i declared

  • January 9, 2021
  • 4 replies
  • 1024 views

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?

This topic has been closed for replies.

4 replies

Uwe Bonnes
Chief
January 10, 2021

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

FManc.1
FManc.1Author
Associate II
January 10, 2021

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

I can't explain why.

FManc.1
FManc.1Author
Associate II
January 10, 2021

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

It's possible that there is a name conflict?

Uwe Bonnes
Chief
January 10, 2021

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

FManc.1
FManc.1Author
Associate II
January 10, 2021

No idea of What could cause this error?

waclawek.jan
Super User
January 10, 2021

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

JW