i'm running codewarrior v4.7 on vista and i have a question regarding the variables that are displayed when i run the debugger.
for instance, the following code dx=calc_x (delta_dist, desired_theta_deg); dy=calc_y (delta_dist, desired_theta_deg); cur_x += dx; cur_y += dy; x_diff=cur_x-goal_x; y_diff=cur_y-goal_y; x_diff_sq=pow(x_diff,2); y_diff_sq=pow(y_diff,2);
xy_diff_sq=x_diff_sq+y_diff_sq; <----- breakpoint
i'm trying to see the values of x_diff_sq and y_diff_sq, however i only see x_diff_sq when i set a break point on xy_diff_sq. what is the problem here? thanks in advance
I suspect this issue may be caused by compiler optimalization. The various optimalizations are turned on in CodeWarrior for HC12 projects by default.
I'd suggest you to try to turn the optimalization off. You can use "Debugger Complexity" slider within the Project settings (ALT+F7) ->"Compiler for HC12" -> "Smart Sliders" button to adjust the optimalization settings.
I suspect this issue may be caused by compiler optimalization. The various optimalizations are turned on in CodeWarrior for HC12 projects by default.
I'd suggest you to try to turn the optimalization off. You can use "Debugger Complexity" slider within the Project settings (ALT+F7) ->"Compiler for HC12" -> "Smart Sliders" button to adjust the optimalization settings.
According to the compiler manual this option is present only for compatibility reasons for HC(s)08. Anyway if you want to get rid of this warning I'd suggest you to remove option "-Oc" from the "Command Line Arguments" editbox in the "Compiler for HC08" settings.
That's because the variables are optimized and the program never puts them on the stack, but keeps them in CPU registers. The CW debugger is too dumb to understand such and therefore the variables won't appear.
If you wish to see the variables during debugging, either disable optimization or make the variables volatile. You can then change back once you are building for release.