you have a so called configuration line.
This line is a combination of fuses (see data sheet) that will be written into the configuration register.
In assembler you write something like this:
__config WDT_OFF & BODEN & HS & DEBUG_ON & LVP_OFF
The names of the defines may be different.
In the above example, the configuration-register would mean the following:
- Watchdog is disabled
- Burn Out Reset is enabled
- High Speed oscillator mode
- Debug on
- Low Voltage Programming off
Just take a look at the data sheet...
EDIT: I forgot the where...
In assembler it is at the top of your program (after the includes).
According to Microchip it should be the first byte of the asm-file and will be the last byte of the hex-file.
In C it is dependent on your compiler. Some compilers don't even need a configuration-line (or word if you prefer to call it so) but you need to take a look at the manual of you compiler to find the option to enable debugging...
Debugging enabled generates some special code that you don't want to have in productional use, but that is needed for in-circuit-debugging. So you have to enable it explicitely.
Mplab might also have a place where you can configure this, but i don't know where
I hope it will help you...