4.6.1.6 Debugger Option

The -mdebugger=type option is intended for use in compatibility with development tools that can act as a debugger. xc8-cc supports several debuggers and these are defined in the table below. Failing to select the appropriate debugger can lead to runtime failure.

Table 4-10. Selectable Debuggers
Type Debugger selected
none No debugger (default)
icd2 MPLAB® ICD 2
icd3 MPLAB ICD 3
icd4 MPLAB ICD 4
icd5 MPLAB ICD 5
pickit2 PICkit 2
pickit3 PICkit 3
pickit4 PICkit 4
pickit5 PICkit 5
realice MPLAB REAL ICE In-circuit Emulator
ice4 MPLAB ICE 4 In-circuit Emulator
snap MPLAB Snap
For example:
xc8-cc -mcpu=16F877AA -mdebugger=icd5 main.c
will ensure that none of the source code is allocated resourced that would be used by the debug executive for an MPLAB ICD 5.

When a debugger is set using this option, a preprocessor macro is defined, allowing your source code to change based on the debugger selection, see 5.14.2 Predefined Macros.

If the debugging features of the development tool are not to be used (for example, if the MPLAB ICD 5 is only being used as a programmer), then the debugger option can be set to none, because memory resources will not be used by the tool in that situation.