1.2.5.4.11 SYS_DEBUG_BreakPoint Macro

1.2.5.4.11 C

#if defined(__DEBUG)
    // For PIC32M based Devices
    #define SYS_DEBUG_BreakPoint()  __asm__ volatile (" sdbbp 0")

    // For ARM based Devices
    #define SYS_DEBUG_BreakPoint()  __asm__ __volatile__ ("bkpt #0");
#else
    #define SYS_DEBUG_BreakPoint()
#endif

1.2.5.4.11 Summary

Inserts a software breakpoint instruction when building in Debug mode.

1.2.5.4.11 Description

This macro inserts a software breakpoint instruction when building in Debug mode.

1.2.5.4.11 Precondition

None.

1.2.5.4.11 Parameters

None.

1.2.5.4.11 Returns

None.

1.2.5.4.11 Example

if (myDebugTestFailed)
{
    SYS_DEBUG_BreakPoint();
}

1.2.5.4.11 Remarks

Compiles out if not built for debugging.