All Manuals > LispWorks User Guide and Reference Manual > 35 The DBG Package

NextPrevUpTopContentsIndex

start-client-remote-debugging-server

Function
Summary

Client side: Start a remote debugging TCP server on the client side.

Package

dbg

Signature

start-client-remote-debugging-server &key port open-callback log-stream setup-default enable => process

Arguments

port

An integer.

open-callback

nil or a function of one argument: the connection.

log-stream

An output stream or nil.

setup-default

nil or t.

enable

nil or t.

Values

process

A process.

Description

The function start-client-remote-debugging-server starts a client side server for remote debugging, which will create a client side remote debugging connection when a remote machine connects to it. With the default settings, this remote debugging connection will become the default connection and will be enabled for re-use whenever a connection is needed (entering the debugger, or calls to start-remote-listener or remote-inspect).

The main operation of start-client-remote-debugging-server is calling start-up-server with port and a function that calls create-client-remote-debugging-connection to create a client for every connection to the server. port defaults to the value of *default-client-remote-debugging-server-port*, which is 21102 initially.

The other keyword arguments affect what else start-client-remote-debugging-server does.

If open-callback is non-nil, it is called with the each new connection that is created. open-callback defaults to nil.

If setup-default is non-nil (the default when open-callback is nil), every new connection is made the default connection by a call to set-default-remote-debugging-connection, and if enable is non-nil (the default), it will be enabled for re-use by set-remote-debugging-connection with argument t. If setup-default is nil (the default when open-callback is non-nil) then enable is ignored. setup-default defaults to (not open-callback).

If log-stream is non-nil, LispWorks writes error messages to it relating to failures during communication on a connection. These failures should not happen normally, but may happen if something writes to the remote debugging connection not through the remote debugging interface. log-stream defaults to nil.

start-client-remote-debugging-server returns process, which is the result of start-up-server, You can use server-terminate to stop it.

Notes

To have a connection, the IDE side needs to connect to the client hostname on port number port using ide-connect-remote-debugging, or code that does similar things.

In normal operation, it is assumed that the IDE side will connect once, and from that point onward this connection will be used for all remote debugging. If the IDE subsequently opens another connection without first closing the first connection, then the first connection will "leak" on the client side. It is the responsibility of the IDE to close it in this case.

open-callback allows more complex usage, for example to store the connection somewhere and use it when required by with-remote-debugging-connection or set-remote-debugging-connection. Note that setup-default is nil by default when open-callback is non-nil.

start-client-remote-debugging-server is implemented using the other functions discussed in this section, so you can can reasonably easily write your own version of it if you need to.

See also

start-up-server
create-client-remote-debugging-connection
set-default-remote-debugging-connection
set-remote-debugging-connection
ide-connect-remote-debugging
Remote debugging


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex