Compilation problem(or not?)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compilation problem(or not?)

1,579 Views
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?
Labels (1)
0 Kudos
2 Replies

386 Views
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 Kudos

386 Views
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 Kudos