> Harold Hallikainen wrote: >>> Yes. You can customize the optimizations used by the compiler. In MPLAB >>> you can go to the compiler settings tab, and choose "none", "debug", >>> "all", and "custom". You need "debug" if you are going to do ICD (at >>> least with the ICD2), otherwise I use "all". The "Custom" option >>> "un-greys" a bunch of individual optimizations available, and you can >>> choose the ones you want. One of them is "Procedural Abstraction". >>> Additionally, when you set up your build you have to either enable or >>> disable the extended instruction set. This is not an "optimization", >>> but >>> a build strategy. >>> >>> Rolf >>> >> >> >> I've run the ICD-2 with all optimization enabled. It works, but the code >> is incredibly hard to follow when you single step since the >> optimizations >> reuse code from one function in another. So you're single stepping along >> and suddenly you're off in some strange location. Keep stepping and >> you're >> back where you should be. Keeping the debug optimization DOES help! >> >> Harold >> >> > Hmmm... while I agree with you, it *can* work, it was just yesterday > that I was unable to create a breakpoint in a particular place because > it was optimized away. I remembered to change my compile settings and it > all worked. > > So, stepping through some optimizations may be OK, but putting > break-points there may not.... > > Rolf I agree! The optimization away from debug does code reuse, so it the program counter really wanders around the address space. You were probably trying to set a break point on some point where the code "wandered away" from that particular point in the source code, so it really didn't know where to put the breakpoint. It's an interesting optimization. Pretty much turns your code into spaghetti. Harold -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist