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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

995件の閲覧回数
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 返答(返信)

907件の閲覧回数
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 件の賞賛
返信

907件の閲覧回数
alexandrevdp
Contributor I

Thank you very much!! I will try this

0 件の賞賛
返信