Really strange problem or error in codewarrior version2.2 with MPC5534 please help

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

Really strange problem or error in codewarrior version2.2 with MPC5534 please help

1,384 Views
saurav99
Contributor I
Hi ,
 
I am using MPC5534 with codewarrior version 2.2.
I have written a .c file and .h file and written a main function 
In main function i am calling some of  the functions which i have defined in .c and delcared in .h.
I am not able to keep break point in the function in which i am not calling in the main but i have written it in .c (defined in .c and decalred in .h).
 
This is really some thing strange i should be able to keep break point in every line of the code  which i have written in .c but this is not happening and its not allowing can any one explain me why it is not happening or why its not allowing.
 
it is showing red dots where i can keep break point and its not showing red dots where its not allowing break points in the code
 
its strange right every line in the code should be allowed to keep break point even though i call it in main or not
 
can any one provide solution to this strange problem so that i cna go forward
 
please help me thanks in advance.
 
Thanks,Regards,
saurav
 
Labels (1)
0 Kudos
2 Replies

325 Views
stanish
NXP Employee
NXP Employee
This is probably the result of dead stripping done by the Linker.  In fact the Linker removes the objects that are not used. e.g. a function that is never called during code execution. It doesn't make sense to add the breakpoint at such line of code.

If you want to avoid dead stripping I'd suggest you to add the  "FORCEACTIVE  { symbol1, symbol2 .... }" into the .lcf file.



Message Edited by stanish on 2008-05-22 11:53 AM
0 Kudos

325 Views
J2MEJediMaster
Specialist I
The other thing to understand is that when you have a lot of compiler optimizations turned on, the compiler reorganizes the generated code, sometimes a lot. For high optimizations levels, there's no longer a one-to-one match between the source statements and the generated object code. The debugger safeguards you against these changes by not allowing you to set breakpoints where there's no corresponding object code. If you want more of a one-on-one match between the object code and the source code, lower the optimization level or turn optimizations off completely.

---Tom

0 Kudos