__debug_break Builtin

A builtin function that triggers a software breakpoint for debug builds.

Include

<xc.h>

Prototype

void __debug_break(void);

Remarks

This is an inbuilt function that is expanded by the code generator for debug builds, but is ignore for production builds. When called, this routine unconditionally triggers a software breakpoint when the code is executed using a debugger.

The software breakpoint code is only generated for mid-range and PIC18 devices. Baseline devices do not support software breakpoints in this way, and the builtin will be ignored if used with these devices.

Example

#include <xc.h>

int main (void)
{
  __debug_break();    // stop here
}