ICDPPCNEXUS Debugger Scope difference

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ICDPPCNEXUS Debugger Scope difference

Jump to solution
3,318 Views
bltripod
Contributor I

Hi all,

I am using CodeWarrior 5.9.0 and P&E micro to debug MPC5604 custom board. I am curious why different global variable has its own Scope range in the attached figure. Sometimes, some global variable with small scope cannot be watched in its called function, which would be displayed with "out of scope" in Description. And I hope to enlarge all global variable scope to full scale, like $00000000 - $40008383, instead of limited small scope.

bltripod_0-1629262885860.png

Hope for your reply and thanks very much !

0 Kudos
Reply
1 Solution
3,285 Views
stanish
NXP Employee
NXP Employee

Hi, 

I'd expect if both variables are declared in a header file as extern they should be globally visible regardless of C module you are debugging.

The scope might change if there are both local and global variable of the same name.

Anyway I found this snippet from ICDPPCNEXUS documentation regarding variable scoping:

"The ICD supports scoping of variables. If you put a variable name in the Variables window, the debugger will show the variable of the same name that is currently in scope. If you had a global integer variable, temp, and a local float variable, temp, within the routine init_port, the float would be shown while you step through the init_port routine. Otherwise, the Variable window would display the integer variable. When a variable value equates to [Not Accessible], this means the variable specified is either out of scope or doesn't exist."

If you have any further question to variable scoping I'd recommend you to contact PEMICRO support directly:

http://www.pemicro.com/forums/index.cfm

 

Regards,

Stan

View solution in original post

0 Kudos
Reply
4 Replies
3,286 Views
stanish
NXP Employee
NXP Employee

Hi, 

I'd expect if both variables are declared in a header file as extern they should be globally visible regardless of C module you are debugging.

The scope might change if there are both local and global variable of the same name.

Anyway I found this snippet from ICDPPCNEXUS documentation regarding variable scoping:

"The ICD supports scoping of variables. If you put a variable name in the Variables window, the debugger will show the variable of the same name that is currently in scope. If you had a global integer variable, temp, and a local float variable, temp, within the routine init_port, the float would be shown while you step through the init_port routine. Otherwise, the Variable window would display the integer variable. When a variable value equates to [Not Accessible], this means the variable specified is either out of scope or doesn't exist."

If you have any further question to variable scoping I'd recommend you to contact PEMICRO support directly:

http://www.pemicro.com/forums/index.cfm

 

Regards,

Stan

0 Kudos
Reply
3,275 Views
bltripod
Contributor I

Hi stanish,

Thanks for your nice help ! 

 

Regards,

bltripod

0 Kudos
Reply
3,303 Views
stanish
NXP Employee
NXP Employee

Hi,

The scope depends on whether a global variable is static.

Obviously static variables have visibility only in specific C module whereas extern global variables should be visible in the entire project.

Is your observations different?

Regards,

Stan

0 Kudos
Reply
3,300 Views
bltripod
Contributor I

Hi stanish,

 

Thanks for your reply at first. I confirm that some global variables without static are with different scopes. For example, variables are in one c file with limit scope when debug. But another variable in another c file without static is visible in the entire project.

I am very confused about such irregular scope difference. Could it be caused by the project configuration or any other reason ? Hope for your reply. Thanks a lot !

 

Regards,

bltripod

 

0 Kudos
Reply