debugserver

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: GPL-3.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package debugserver implements the emulator debug server. It speaks a bare line protocol over a localhost TCP port and provides execution control, memory inspection, held memory locations, a cheat-search style memory search, and in-memory machine snapshots. The package has no UI dependencies. A host wires it to the emulator through the Machine interface and calls Service between frames.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine interface {
	// ReadMemory reads guest memory at a canonical native bus address
	// into buf and returns the number of bytes read.
	ReadMemory(addr uint32, buf []byte) uint32
	// WriteMemory writes data to guest memory at a canonical native
	// bus address and returns the number of bytes written.
	WriteMemory(addr uint32, data []byte) uint32
	// Regions is the machine's accessible bus region table.
	Regions() []core.BusRegion
	Serialize() ([]byte, error)
	Deserialize(data []byte) error
}

Machine is the emulator surface the server needs. Memory access is canonical native bus addressed and gated by the machine's region table, the same table the memory access methods serve from.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server owns the listener and all debug state (watches, breaks, pins, searches, snapshots). Connection goroutines read lines and queue clientCmds. The emulation goroutine drains the queue between frames (Service), so command handlers run on the emulation goroutine and everything below the queue is owned by it.

func Start

func Start(port int, m Machine, paused *atomic.Bool) (*Server, error)

Start listens on 127.0.0.1:port and serves clients. The paused flag is shared with the host's pause control.

func (*Server) Service

func (c *Server) Service(frame uint64)

Service runs the server's between-frames work: pin restores, watch reads, and queued commands. The host calls it once per emulation loop iteration with the current RunFrame count. Pins are restored first so everything downstream observes the held values.

func (*Server) TakeStep

func (c *Server) TakeStep() bool

TakeStep reports whether a client frame step is pending and consumes one frame from it. The host calls it while paused to decide whether to run a frame anyway.

Directories

Path Synopsis
Package responses holds the shared data types of the debug server's JSON responses: the server serializes them as the data field of its response envelopes and the debugger client decodes them.
Package responses holds the shared data types of the debug server's JSON responses: the server serializes them as the data field of its response envelopes and the debugger client decodes them.

Jump to

Keyboard shortcuts

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