Case statements are apparently optimized down to a jump table which prevents me from setting a breakpoint onto a particular case in the switch statement.
1) How can I set a breakpoint to a particular case in a switch statement?
2) How does one change the level of optimization applied in the compile step or set options like bounds checking etc?
Thanks for any help.
David
Hi
what chip and CW version do you work with?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
hi,
1. we can't set a breakpoint as specific code such as case 0:.
here is a piece of disassemble code i extracted for switch...case
we can see there is no "real" disassembly code allocated in memory for "case 0". so it's not possiable to set a breakpoint at this line.
2. CW for HCS08 doesn't define a optimization level. but we can disable optimization in compiler option settings
can this help you?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you for your reply. I see what you mean.
David