Debugger keywords in PureBasic

Overview

A complete description of all functions of the powerful debugger you will find in the extra chapters Using the debugger or Using the debugging Tools.

Following you will find an explanation of the debugger commands, you can directly use in your source code.


Syntax

  CallDebugger
  
Description
This invokes the "debugger" and freezes the program immediately.

Syntax
  Debug <expression> [, DebugLevel]
  
Description
Display the DebugOutput window and the result inside it. The expression can be any valid PureBasic expression, from numeric to string. An important point is than the Debug command and its associated expression is totally ignored (not compiled) when the debugger is deactivated.

Note: This is also true, if you're using complete command lines after Debug (e.g. Debug LoadImage(1,"test.bmp")). They will not be compiled with disabled debugger!

This means than this command can be used to trace easily in the program without having to comment all the debug commands when creating the final executable.

The 'DebugLevel' is the level of priority of the debug message. All normal debug message (without specifying a debug level) are automically displayed. When a level is specified then the message will be displayed only if the current DebugLevel (set with the following DebugLevel command) is equals or above this number. This allows hierarchical debug mode, by displaying more and more precise informations in function of the used DebugLevel.

Syntax

  DebugLevel
Description
Set the current debug level for the 'Debug' message.

Note: The debug level is set at compile time, which means than you have to put the DebugLevel command before any other Debug commands to be sure it affects them all.

Syntax
  
  DisableDebugger
Description
This will disable the debugger checks on the source code which follow this command.

Syntax
  
  EnableDebugger
  
Description
This will enable the debugger checks on the source code which follow this command (if the debugger was previously disabled with DisableDebugger).