Compilation problem(or not?)

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

Compilation problem(or not?)

2,073 次查看
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 回复数

880 次查看
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 项奖励
回复

880 次查看
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 项奖励
回复