breakpoint;
//!
Places a breakpoint in the current code line (alternatively to the SED [F9] breakpoint key). When execution reaches this code position, the application freezes and the
debugger
is activated
for single stepping through script code. The current
script line is displayed in SED, as well as in the engine
title bar (lite-C) or engine window (C-Script).
By pressing
[F10]
the instruction is executed and the next command appears.
By further pressing [F10], the function is executed
line by line and the results of the expressions can be examined. On
pressing
[Ctrl-F10]
the debugger is deactivated and normal function execution will continue
until another or the same breakpoint is reached again.
[Shift-F10] steps
over function calls (lite-C only).
On pressing
[Esc]
debugging is terminated for the current session, and all further breakpoints
are ignored.
Remarks:
-
For debugging the engine must be started with the -debug command line option; otherwise breakpoints are ignored.
-
The line must contain code; breakpoints can not be placed in empty lines or lines that only contain comments or variable definitions.
- Breakpoints can not be directly placed in shaders, events, and particle functions. However event functions can be
made debuggable by placing a wait(1) before the
first breakpoint.
-
Breakpoints are ignored in the runtime
module
and in legacy mode programs (with a WinMain() function). The //! comment tag can only be set in the main file, not in an include file; [F9] breakpoints in SED however can also be set in include files.
- Material events and particle functions are suspended during
debugging.
wait() instructions are ignored when single stepping.
- When placing breakpoints into an entity event function, or into
the first part of an entity action before the first wait,
other entities are not updated during debugging and thus may appear
at wrong places.
- To prevent debugging into a certain function, set debug_mode
= 0; at its beginning.
- Variables and objects can be examined by defining watches in SED. For examining variables in the engine window, define a
PANEL with digits.
-
Debugging is described in detail in the lite-C tutorial.
Example (lite-C):
Conditional breakpoints can be placed by entering an if condition followed by an arbitrary command,
like
// breakpoint only if [B] is pressed
if (key_b)
beep(); //!
See also:
beep, diag, watched,
debugging, debug_external, debug_mode, wait
► latest
version online