Help us shape the future of Go! Take the 2026 Go Developer Survey

dapserver

package
v1.95.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0

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 New

func New(engine *debugger.Engine) *Server

New creates a new DAP server wrapping the given 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

func (s *Server) ServeListener(ln net.Listener) error

ServeListener accepts a single connection from the listener and serves DAP messages on it.

func (*Server) ServeStdio

func (s *Server) ServeStdio(r io.Reader, w io.Writer) error

ServeStdio serves DAP messages on the given reader and writer, typically os.Stdin and os.Stdout.

func (*Server) ServeTCP

func (s *Server) ServeTCP(addr string) error

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

func (s *Server) ServeTCPLoop(addr string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL