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

start-ide-remote-debugging-server Function

Summary

IDE side: Start an IDE side remote debugging server, so clients can connect to it.

Package

dbg

Signature

start-ide-remote-debugging-server &key port socket-filter name log-stream announce error connection-callback ssl ipv6 => server-process

Arguments
port
An integer or string.
socket-filter
A function of one argument or nil.
name
A string.
log-stream
An output stream or nil.
announce
A function of two arguments or a stream, t or nil.
error
A boolean (default t).
connection-callback
A function of two arguments or nil.
ssl
A SSL client context specification.
ipv6
:any (the default), t, or nil.
Values
server-process
A process handling incoming connections.
Description

The function start-ide-remote-debugging-server starts a TCP server (by calling start-up-server) that creates IDE remote debugging connections.

port must be an integer port number or string service name. It is supplied as the service argument to start-up-server. port defaults to the value of *default-ide-remote-debugging-server-port*, which is 21101 initially.

name is used in the name of the created connections.

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.

If socket-filter is non-nil, it is called with the connected socket before creating the connection, and if it returns nil then the socket is closed and no connection is created. socket-filter defaults to nil.

The server creates IDE remote debugging connections by calling create-ide-remote-debugging-connection with the connected socket, a name (constructed from name, the peer address of the socket and a counter) and log-stream.

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

If connection-callback is non-nil, then after start-ide-remote-debugging-server has tried to open a connection (that is it got a TCP socket and it passed socket-filter if any), it calls connection-callback with two arguments. If it succeeded to open the remote debugging connection, the first argument is the new connection and the second is nil. If it failed, the first argument is nil and the second one is the condition.

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-ide-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-ide-remote-debugging-server returns server-process, which is the first result of start-up-server. You can terminate the server by calling server-terminate with server-process.

Notes

The client would normally open a connection using configure-remote-debugging-spec with host specifying the machine on which start-ide-remote-debugging-server has been called with the same port as port (which defaults to the value of *default-ide-remote-debugging-server-port* for both functions).

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

The underlying TCP stream functionality must be working between the machines, that is they must be able to connect by TCP.

When using the Remote Debugger, Remote Listener or Inspector, you do not need to access the connection directly because the tools do it for you. In addition, create-ide-remote-debugging-connection remembers the connection, so all the IDE side functions that look for connections will find it.

socket-filter can call get-socket-peer-address to check who is connecting. It can also be used just to log that a connection has been made, but must return t in this case.

You could easily implement your own version of start-ide-remote-debugging-server if needed using start-up-server and create-ide-remote-debugging-connection.

See also

start-up-server
create-ide-remote-debugging-connection
3.7 Remote debugging


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