Does anyone else have problems with the simulator? Most of the time it works great but every now and then when code changes are made and recompiled its like the debug and code info dont match up anymore and the cursor showing the execution doesnt follow the program correctly
every now and then when code changes are made and recompiled its like the debug and code info dont match up anymore and the cursor showing the execution doesnt follow the program correctly Could this be a side-effect of optimization? Refer to http://www.keil.com/support/docs/2467.htm for more details. Jon
I've seen something like this before aswell. At least if it's the same problem..???? What I've seen is that if I step through the code, occationally the code coverage beam (the one that turns green) isn't in sink with the code processed. I usually restart the program and everything works ok again Regards John
The problem was due to compiler optimization. I had 2 lines of code between if else statements and by changing one of them slighty it worked in the simulator.
Just a general observation. If you want to simulate (poor you) or emulate (all right!) you should never optimize beyond level 2 (someone from Keil please confirm that any level beyond 2 will screw up the source/object relationship). I adhere to the NASA paradigm "we fly what we test" Thus no product of mine is optimized beyond 2. Erik
"If you want to simulate (poor you) or emulate (all right!) you should never optimize beyond level 2" I disagree. That should read: "If you optimize beyond level 2 (or whatever), you must understand that source-level debugging will become difficult or even impossible" How difficult it becomes will depend on the nature of your code, and gets worse the harder you optimise (higher optimisation level setting). "There is no gain without pain" "There is no such thing as a free lunch" As ever, to use the tools effectively you need to understand them! "I adhere to the NASA paradigm 'we fly what we test'" Absolutely - and test what you fly! ie, if you intend to ship code built at optimisation level X, then you must do all your debugging & testing at level X.
OK, the same but more precise. It would still be nice, if someone from the Keil coding team could state at which optimization level the absolute ability to set a breakpoint at any spot is lost. Erik
"It would still be nice, if someone from the Keil coding team could state at which optimization level the absolute ability to set a breakpoint at any spot is lost." Please read the manual! http://www.keil.com/support/docs/2467.htm