setting breakpoints don´t work correctly - it turn to next lines - why?

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

setting breakpoints don´t work correctly - it turn to next lines - why?

997 次查看
alexandrevdp
Contributor I

01 for(i=0;i<var;var++)

02 {

03     a= 0;    I put breakpoint here and the codewarrior put on line 05. Why? How can I fix this on debug window of codewarrior 10.6

04     b = 0;

05     c =0;

06 }

标签 (1)
0 项奖励
回复
2 回复数

909 次查看
BlackNight
NXP Employee
NXP Employee

Hello Alexandre,

that very much depends on optimizations and how/where you have the variables a, b and c. If they are local variables for example, the compiler will see that they are only written once with zero and never change. For 'bad' code like this the debug exprience will be bad too. You can prevent the compiler optimization with disabling the optimizations or mark the variables with 'volatile' keyword.

Erich

0 项奖励
回复

909 次查看
alexandrevdp
Contributor I

Thank you very much!! I will try this

0 项奖励
回复