Skip to main content

Client library and CLI for DOSBox-X remote debug protocols (GDB and QMP)

Project description

dbxdebug

Client library and CLI for DOSBox-X remote debug protocols.

Features

  • GDB Client: Remote debugging via GDB Remote Serial Protocol

    • Memory read/write
    • Register inspection
    • Breakpoint management
    • Execution control (step, continue, halt)
  • QMP Client: Keyboard input via QEMU Monitor Protocol

    • Key press/release with timing control
    • Text typing with shift handling
    • Key combinations (Ctrl+C, Alt+F4, etc.)
  • Video Tools: DOS text mode screen capture

    • Screen capture (text, raw, HTML)
    • Timed multi-frame recording
    • Color analysis
    • BIOS timer correlation

Installation

uv sync

CLI Usage

dbxdebug
├── mem              # Memory operations (alias: gdb)
│   ├── read         # Read memory
│   └── write        # Write hex bytes
│
├── cpu              # CPU and execution control
│   ├── regs         # Display registers
│   ├── break        # Set breakpoint
│   ├── delete       # Remove breakpoint
│   ├── step         # Single step
│   ├── cont         # Continue execution
│   └── halt         # Stop execution
│
├── key              # Keyboard input (alias: qmp)
│   ├── send         # Key chord (e.g., ctrl c)
│   ├── type         # Type text string
│   ├── down         # Press and hold key
│   ├── up           # Release key
│   └── list         # List QMP commands
│
└── screen           # Screen capture
    ├── show         # Display text to stdout
    ├── capture      # Save frame to file (-f raw|html|text)
    ├── record       # Multi-frame timed capture
    ├── watch        # Real-time display
    ├── info         # Video mode, BIOS ticks
    └── colors       # Analyze color palette

Examples

# Memory
dbxdebug mem read b800:0000 4000 --hex
dbxdebug mem write 0x1000 90909090

# CPU / Debugging
dbxdebug cpu regs
dbxdebug cpu break 0x1000
dbxdebug cpu step
dbxdebug cpu cont

# Keyboard
dbxdebug key send a
dbxdebug key send ctrl c
dbxdebug key send ctrl alt delete
dbxdebug key type "Hello World!"

# Screen
dbxdebug screen show
dbxdebug screen capture -f html -o snapshot
dbxdebug screen record -d 60 -r 30 -o session.capture.gz
dbxdebug screen watch
dbxdebug screen colors

Library Usage

from dbxdebug import (
    GDBClient, QMPClient, DOSVideoTools,
    ScreenRecorder, load_capture,
    ctrl_key, CTRL_C, DBX_KEY,
)

# Memory and debugging
with GDBClient() as gdb:
    regs = gdb.read_registers()
    mem = gdb.read_memory("b800:0000", 4000)
    gdb.write_memory(0x1000, b"\x90\x90")
    gdb.set_breakpoint(0x1000)
    gdb.step()
    gdb.continue_execution()

# Keyboard input
with QMPClient() as qmp:
    qmp.send_key(["ctrl", "c"])       # Key chord
    qmp.send_key(CTRL_C)              # Using constant
    qmp.type_text("Hello World!")     # Type string
    qmp.key_down("shift")             # Hold key
    qmp.key_up("shift")               # Release key

# Screen capture
with DOSVideoTools() as video:
    lines = video.screen_dump()           # Text lines
    raw = video.screen_raw()              # Raw bytes with attrs
    lines, ticks = video.screen_dump_with_ticks()

# Timed recording
with DOSVideoTools() as video:
    recorder = ScreenRecorder()
    recorder.record(video, duration=10.0, sample_rate=50)
    recorder.save("session.capture.gz")

# Load and analyze capture
data = load_capture("session.capture.gz")

Ports

Protocol Default Port Purpose
GDB 2159 Debugging, memory access
QMP 4444 Keyboard input

Enable in DOSBox-X config:

[dosbox]
gdbserver=true
qmpserver=true

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbxdebug-0.2.1.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbxdebug-0.2.1-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file dbxdebug-0.2.1.tar.gz.

File metadata

  • Download URL: dbxdebug-0.2.1.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dbxdebug-0.2.1.tar.gz
Algorithm Hash digest
SHA256 abf437329d240fcb810bbecb0f8fee82c6f653c5e1c7fde2b47aa0f1aeb47d78
MD5 eec9e69fbff36a7e34975f2f4528079c
BLAKE2b-256 056c5cbbc71c118d8ab1f5f8ee6b0ec00bd7b588d28d8819bd9a5c71224afd4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbxdebug-0.2.1.tar.gz:

Publisher: publish.yml on lokkju/dbxdebug

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbxdebug-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dbxdebug-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dbxdebug-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73e3b17f35337462775a0afb04b9b00457f2c54ee1a8e4c93179240d1b05be0d
MD5 513131b80aeefbc6ab8b4b9d00adff3e
BLAKE2b-256 f724606e165dda1b7880aa9568e229d4e62c004adc1b6a5926581f5a72b8de4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbxdebug-0.2.1-py3-none-any.whl:

Publisher: publish.yml on lokkju/dbxdebug

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page