ICDPPCNEXUS Debugger Scope difference

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ICDPPCNEXUS Debugger Scope difference

跳至解决方案
3,315 次查看
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 项奖励
回复
1 解答
3,282 次查看
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 项奖励
回复
4 回复数
3,283 次查看
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 项奖励
回复
3,272 次查看
bltripod
Contributor I

Hi stanish,

Thanks for your nice help ! 

 

Regards,

bltripod

0 项奖励
回复
3,300 次查看
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 项奖励
回复
3,297 次查看
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 项奖励
回复