3.4.3 What Do I Need to Do When Compiling to Use a Debugger?

You can use debuggers, such as the PICkit™ 5 in-circuit debugger or the MPLAB ICD 5 in-circuit debugger, to debug code built with the MPLAB XC32 compiler. When a debug Run is requested, a debug executive is automatically downloaded with your program image. This debug executive might use some of the device memory for its own purposes, making this memory off-limits to your program. These resources will not be used if you are not debugging and you perform a regular Run, Build Project, or Clean and Build.

Typically, no memory will be required by the debug executive when the debugger is connected to PIC32C/SAM devices (although this is not necessarily true for PIC32M devices). It is important that no memory used by the debugger is also used by your program.

See also 3.5.15 Why are Some Objects Positioned into Memory that I Reserved?.