3.2.7 What is Different About an MPLAB X IDE Debug Build?

In MPLAB X, there are distinct build buttons and menu items to build (production build) a project and to debug (debug build) a project.

When performing a debug build, the IDE will also set the configuration bit to allow debugging of the project by a debug tool, such as the MPLAB ICD 4.

In MPLAB X IDE, memory is reserved for your debugger (if selected) only when you perform a debug build. See 3.4.4 What Do I Need to Do When Compiling to Use a Debugger?

Another difference is the setting of a preprocessor macro called __DEBUG, which is assigned 1 by the MPLAB X IDE when performing a debug build. This macro is not defined for production builds. You can make code in your source conditional on this macro using #ifdef directives, etc., (see 5.14.1 Preprocessor Directives); so your program will behave differently when in a development cycle.