Skip to content

$break

Version information

Introduced in version v0.2

This macro is considered stable

About

The $break macro allows the programmer to insert breakpoint locations. Once breakpoints are placed they can be enabled by their file path or ID later in the debugger using the break command.

For conditional breakpoints see the $cbreak macro.

Notes

Required environment

  • This macro requires the debug server to have been initialized before being called.
  • This macro requires the current thread to be supervised with $ntask or V5Dbg_Init
  • This macro requires the current function to be debuggable

Example

#include "v5dbg/debug.h"

void
opcontrol()
{
    $ntask
    $function

    int i = 0; // Incrementor

    float randomData = 0;
    $expose(randomData);

    while (true)
    {
        pros::lcd::print("%i", i);

        $break; // (1)

        i++;
    }
}
  1. Our breakpoint will be placed here and can be enabled using the break command in the debugger