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

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 announce error ssl ipv6 => 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.
announce
A function of two arguments or a stream, t or nil.
error
A boolean (default t).
ssl
A SSL client context specification.
ipv6
:any (the default), t, or nil.
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.

announce, error and ipv6 have the same meaning as in start-up-server.

If ssl is non-nil, then the connection is made using SSL. This is done by passing ssl as the ssl-ctx argument to create-client-remote-debugging-connection when creating each connection. To be able to configure the SSL connection options, including setting the certificates, you can supply a comm:ssl-abstract-context. Note that ssl will be used repeatedly.

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.

It is possible to override the default value of port by configuring the service name lw-remote-debug-client. On a machine where this service is registered, if port is not given then the registered value is used instead of *default-client-remote-debugging-server-port*.

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
3.7 Remote debugging


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:32