New developments. For the onlookers, the above "debug.inc" starts off like this: #ifdef __DEBUG #ifndef __MPLAB_DEBUGGER_ICD2 #ifndef __MPLAB_DEBUGGER_ICD3 ... Pretty much what I said before...the idea is, that if no debugger can be identified, then it must be the SIM. So I set out to demonstrate that none of these labels appear when using C32 under MPLAB. Only, this time, I noticed that the pulldown "box" was set to Release. MPLAB wasn't complaining because I had disconnected the target (didn't want to be programming it over and over during my tests). So I changed it from Release to Debug, and all those labels appeared! D'oh. OK, now we're getting somewhere. I also found a command for gcc I'd never seen before. gcc -E -dM It's a variant of the -E option, which outputs the preprocessed code without compiling it. Supposedly, you can tell from the results what the preprocessor just did. This is even better. -dM, when used with -E, is essentially, "dump the macros". It prints out every macro and its value. This is what I love about open source. Enough people thought that the compiler really should have this feature, so someone put it in. Anyway, now the results of testing show that with the pulldown set to Debug, the label __DEBUG does appear. And so do the other ones for the debuggers. If you have a RealICE you can also get __MPLAB_DEBUGGER_REAL_ICE. There are a few "demo board" settings as well as a few "can't find 'em" debuggers that I installed, and most of those show up as a PK3 for some reason. But nothing for SIM. Thus, we will have to take the above approach and conclude that SIM is what you have when nothing else matches. So, that's what I'll do. Thanks to everyone for your suggestions and your persistence. P.S. On 25/04/2013 07:28, Ruben J=F6nsson wrote: > > I use the check at compile-time BUT I pay big attention to not alter > sensible > timing and program memory size because want to simulate the "same" > firmware. Actually, one of the simulator issues is that the core clock runs 10 times slower than normal. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .