Compilation problem(or not?)

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

Compilation problem(or not?)

1,772件の閲覧回数
israel
Contributor I
Hi,
I am working on codewarior and got myself into a strange position.
when I compile my code and try to run it, I noticed that my newest code does not compile properly. I know it because I can not put any breakpoint on this line of code. and it skip these lines while steping in.
any ideas?
ラベル(1)
0 件の賞賛
返信
2 返答(返信)

579件の閲覧回数
alex_spotw
Contributor III
Hi:

Chances are your new code is being optimize out by the compiler.

First of all, check that your code does not generate ANY warning.

Second, set the compiler to generate an error (not a warning) on Implicit parameter declaration.

Third, check that variables used in an Interrupt Service Routine (ISR) are declared volatile

Fourth, check that your new code is actually doing something. Compilers usually remove dead assignments and code that does nothing (adding to variables that are not used, etc).

Attaching yout code in the posts might be useful, as well.

Regards,

Alex.
0 件の賞賛
返信

579件の閲覧回数
CrasyCat
Specialist III

Hello

I assume you are using CodeWarrior for HC12. Am I right?

If this is the case, I assume also tat you tried to put the breakpoint in the Debugger source window after the code has been downloaded.

CodeWarrior for HC12 is using an external debugger and you cannot set a breakpoint in an editor window.

Additionally a quick Tip to move forward (also only valid if you are using CW HC12).

After you have downloaded your code to the target, bring the code of the function you are interested in in the Source Window (Use menu entry "Source" -> ""Find procedure" for that).

THen select "Source" -> "Marks". This will insert a small red mark in front of each instruction where you can set a breakpoint.

If the source line you are referring to does not have marks, that means either the function or the instruction does not generate code.

Then we will have to start investigating from there.

Is the whole function without mark? Or just an instruction?

CrasyCat

0 件の賞賛
返信