Switch/Case Statement debugging / tracing

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

Switch/Case Statement debugging / tracing

3,218 Views
zdjohnson
Contributor I

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

Labels (1)
0 Kudos
Reply
4 Replies

2,871 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,871 Views
zdjohnson
Contributor I

I am using CodeWarrior CW_MCU_V6_3_SE with Freescale MC9S08QE64 (HCS08).

David

0 Kudos
Reply

2,871 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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

pastedImage_0.png

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

pastedImage_1.png

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!
-----------------------------------------------------------------------------------------------------------------------

2,871 Views
zdjohnson
Contributor I

Thank you for your reply.  I see what you mean.

David

0 Kudos
Reply