DebugBreak()

The function allows to set a debug break point.

Synopsis

int DebugBreak([bool doBreak = true]);

Parameter

Parameter Description
doBreak Boolean parameter or argument that defines if the break point should be triggered or not.

Return Value

The function always returns 0.

Errors

-

Description

If the function is called with a TRUE argument (or any argument) the CTRL interpreter stops the running thread and waits for further commands. This is the same as if a user would send the "break" command to a CTRL manager via the CTRL Debugger panel.

The function can be used to create break points in scripts that normally cannot be interrupted, e.g. all kind of init scripts.

As the argument is a bool, any kind of expressions can be used to determine if the break should be done.

main()
{
  int a = 6;
  DebugBreak(a > 5);
}

By default the Debug break points are deactivated (the thread cannot be halted) and must be activated by using the CTRL_DEBUGBREAK debug flag. Following options are available to set the flag:

  • For the GEDI the flag is activated by default. It can be enabled or disabled with the "Tools" > "DebugBreak() active" button.
  • Using the CTRL function setDbgFlag("CTRL_DEBUGBREAK", TRUE)
  • Using the CTRL Debugger command "setDbgFlag CTRL_DEBUGBREAK 1"
  • Using the manager parameter "-dbg CTRL_DEBUGBREAK".

Assignment

-

Availability

CTRL, UI