I mostly write C code for HCS08 and sometimes I set breakpoints for debugging some issue.
Sometimes in C code breakpoints fail to set in some source lines, in my experience mostly problems related to blank lines, code writing style that fools the debugger or compiler optimized code (I guess). When this happens I usually try to set the breakpoint somewhere else within the code and problem solved.
These days I am trying to teach HCS08 assembler to a small group of beginners, CodeWarrior 11.1 IDE refuses to set any breakpoints, and instead a crossed out symbol (the usual blue bullet breakpoint symbol) appears. So I end up using "Run to line" command which is not what I want. Instruction trace works fine, (Step Over and Step Into commands). The same programming tool and hardware is been used for C and Assembler projects.
Also, once the code is correctly assembled and after FLASH programming, the debugger never starts at _Startup. Instead an extra tab appears in the debugger code window section called main(). RESET vector is correctly defined in the absolute Assembler source code listing. The Reset Target arrow button solves this last problem and the debugger positions itself at the _Startup label as expected. But still breakpoints do not work.
Any ideas of what am I doing wrong for this 2 issues? Thanks in advance
Thank you Jennie, problem solved.
Normally, if a specific line of code is optimized, the breakpoint can't be set there.
Please do clean the object code then rebuild. if still can't set the breakpoint, please upload demo project. I will check the problem directly.