__DEBUG Macro

MPLAB® X IDE generates debug macros for use with Microchip language tools. Macros passed to Microchip compilers and assemblers are shown in the following table:

Macro Name Function
__DEBUG Specifies that this is a debug build.
__MPLAB_DEBUGGER_REAL_ICE Specifies that the REAL ICE™ debug tool is in use.
__MPLAB_DEBUGGER_ICD3 Specifies that the ICD3 debug tool is in use.
__MPLAB_DEBUGGER_PK3 Specifies that the PICkit™ 3 debug tool is in use.
__MPLAB_DEBUGGER_PICKIT2 Specifies that the PICkit™ 2 debug tool is in use.
__MPLAB_DEBUGGER_PIC32MXSK Specifies that the PIC32MX Starter Kit debug tool is in use.

You may use these macros in your own code. For example:

Project Configurations and Debugging

One good use of project configurations is for creating your own debug configuration. Although MPLAB X IDE provides debug macros for use with Microchip tools, you may want to use your own debug macros or you may want to set up the same debug capabilities with third-party tools.

The content on this page is being updated from a previous version. While the information above is now up to date, we will be adding some new content shortly to provide an in depth-example.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.