Documentation
¶
Overview ¶
Package dapserver implements a DAP (Debug Adapter Protocol) server for the ELPS debugger engine. It translates between the DAP wire protocol and the debugger.Engine interface.
The server supports two transport modes:
- TCP: Primary mode for embedded/attached debugging. The server listens on a TCP port and accepts a single client connection.
- Stdio: For CLI use (e.g., "elps debug --stdio"). The server reads from stdin and writes to stdout, as expected by editors like VS Code when launching a debug adapter as a child process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a DAP protocol server that wraps a debugger Engine.
func (*Server) ServeConn ¶
func (s *Server) ServeConn(conn io.ReadWriteCloser) error
ServeConn serves DAP messages on a single connection. It blocks until the connection is closed or a disconnect request is received.
func (*Server) ServeListener ¶
ServeListener accepts a single connection from the listener and serves DAP messages on it.
func (*Server) ServeStdio ¶
ServeStdio serves DAP messages on the given reader and writer, typically os.Stdin and os.Stdout.
func (*Server) ServeTCP ¶
ServeTCP listens on the given address and serves a single DAP client. It blocks until the client disconnects.
func (*Server) ServeTCPLoop ¶ added in v1.22.0
ServeTCPLoop listens on the given address and accepts connections in a loop. Each connection gets its own handler while sharing the same engine. When a client disconnects, the server resets and accepts the next connection. This is designed for long-lived embedded servers (e.g., substrate) where the DAP server must survive client reconnections. It blocks until the listener encounters an unrecoverable error.