Sign in Join
FPDoc Onlineexperiment

DbugIntf unit

Unit to send commands to a debug server process.

Use dbugintf to add debug messages to your application. The messages are not sent to standard output, but are sent to a debug server process which collects messages from various clients and displays them somehow on screen.

The unit is transparent in its use: it does not need initialization, it will start the debug server by itself if it can find it: the program should be called debugserver and should be in the PATH. When the first debug message is sent, the unit will initialize itself.

The FCL contains a sample debug server (dbugsvr) which can be started in advance, and which writes debug message to the console (both on Windows and Linux). The Lazarus project contains a visual application which displays the messages in a GUI.

The dbugintf unit relies on the SimpleIPC mechanism to communicate with the debug server, hence it works on all platforms that have a functional version of that unit. It also uses TProcess to start the debug server if needed, so the process unit should also be functional.

Procedures and functions

FreeDebugClientprocedure
GetDebuggingEnabledfunctionCheck if sending of debug messages is enabled.
InitDebugClientfunctionInitialize the debug client.
SendBooleanfunctionSend the value of a boolean variable.
SendDateTimefunctionSend the value of a TDateTime variable.
SendDebugfunctionSend a message to the debug server.
SendDebugExfunctionSend debug message other than informational messages.
SendDebugFmtfunctionFormat and send a debug message.
SendDebugFmtExfunctionFormat and send message with alternate type.
SendIntegerfunctionSend the value of an integer variable.
SendMethodEnterfunctionSend method enter message.
SendMethodExitfunctionSend method exit message.
SendPointerfunctionSend the value of a pointer variable.
SendSeparatorfunctionSend a separator message.
SetDebuggingEnabledprocedureTemporary enables or disables debugging.
StartDebugServerfunctionStart the debug server.

Types

TDebugLevelenumerationLevel of the message.
TErrorLeveltypeInteger array type with error levels as integer.

Resource strings

SEnteringresource stringString used when sending method enter message.
SExitingresource stringString used when sending method exit message.
SProcessIDresource stringString used when sending identification message to the server.
SSeparatorresource stringString used when sending a separator line.
SServerStartFailedresource stringString used to display an error message when the start of the debug server failed.

Variables

DebugServerExevariableName of default debug server executable.
DefaultDebugServervariableName of default debug server.
RaiseExceptionOnSendErrorvariable
SendErrorvariableLast error in the debug system.

Topics

debugserverstopicWriting a debug server.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.