- Lua 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| LICENSES | ||
| lua/dolphin-dap | ||
| tests | ||
| .dolphin-dap.example.lua | ||
| COPYING | ||
| lazy-dolphin-dap.lua | ||
| README.md | ||
Dolphin DAP for Neovim
This plugin configures nvim-dap to launch or attach to Dolphin's DAP server.
Pre-requisites
- Neovim with
vim.fssupport (0.10 or newer). nvim-dapand a current Dolphin DAP build.- A legally obtained game image. For typed source debugging, use a debug ELF with MWCC/CodeWarrior DWARF 1.1 and its matching source files; arbitrary GCC/Clang ELFs with modern DWARF are not a substitute. See the debug-information limits.
- Optional:
nvim-dap-uiandnvim-niofor the debugger interface.
Installation
Using lazy.nvim:
{
"LiveMindIO/dolphin-dap-nvim",
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
"nvim-neotest/nvim-nio",
},
config = function()
require("dolphin-dap").setup()
end,
}
Without nvim-dap-ui, keep this plugin and nvim-dap, remove the UI dependencies,
and use this lazy.nvim specification instead:
{
"LiveMindIO/dolphin-dap-nvim",
dependencies = { "mfussenegger/nvim-dap" },
config = function()
require("dolphin-dap").setup({ setup_dap_ui = false })
end,
}
The complete plugin specification is in lazy-dolphin-dap.lua.
Configuration
Configure Melee
Create .dolphin-dap.lua in the Melee project root:
return {
dolphin = "~/projects/dolphin-dap/build/Binaries/dolphin-emu-nogui",
program = "~/games/melee.iso",
elf_file = "~/projects/melee/build/GALE01/main.elf",
replace_disc_executable = true,
cwd = "~/projects/melee",
source_paths = {
"~/projects/melee/src",
"~/projects/melee/libs/dolphin/src",
},
enable_cheats = false,
port = 5678,
}
Change the Dolphin, Melee, and ISO paths for your machine. Dolphin boots the ISO through
its normal disc bootstrap, then replaces its DOL with the configured ELF. Keep
source_paths ordered as shown so Dolphin can resolve basename-only MWCC paths such as
__start.c.
Build current upstream Melee with python3 configure.py --debug followed by ninja.
Use python on Windows if that is your Python command. Older checkouts may use
extern/dolphin/src rather than libs/dolphin/src; source roots must match the
checkout used to build the ELF.
The same configuration is available as .dolphin-dap.example.lua.
On Windows, set dolphin to your built DolphinNoGUI.exe, set
dolphin_gui explicitly to Dolphin.exe if using Qt, and use platform = "win32".
Use absolute paths such as C:/tools/dolphin-dap/DolphinNoGUI.exe.
Use
- Run
:DapContinueand select Dolphin launch nogui (video, …) for a game window, Dolphin launch headless for no window, or Dolphin launch (Qt) for the Qt binary. - Run
:lua require("dolphin-dap").attach()to attach to Dolphin on the configured port. - Run
:DolphinDapCmdto print and copy the equivalent Dolphin command.
The Qt launch requires a separate Qt-enabled Dolphin build. For build instructions and using its native source debugger, see the Qt source-debugging guide.
First source breakpoint
- Open a source file from the checkout used to build the ELF. Move to an executable
line and run
:DapToggleBreakpoint. - Run
:DapContinueand select a launch configuration. The initial stop may show startup disassembly; run:DapContinueagain to reach your breakpoint, performing the relevant action in the game if needed. - Use
:DapStepOver,:DapStepInto, and:DapStepOutto step. Withnvim-dap-ui, inspect Scopes and Stacks; without it, open:DapToggleRepland evaluate expressions such asr3. Locals are available for the top frame only. - Run
:DapDisconnectto disconnect. For a plain attach, Dolphin was started separately and remains running; stop that process yourself when finished.
If a breakpoint is unverified, choose a line with executable code and check that the ELF was built from this checkout with debug information enabled.
When this plugin starts Dolphin, it passes source_paths through
Dolphin.Debug.SourcePaths. Use the command printed by :DolphinDapCmd when starting
Dolphin separately.
The plugin automatically includes this CLI override in all launch/spawn configurations
and the command printed by :DolphinDapCmd:
-C Dolphin.Interface.DebugModeEnabled=True
When writing your own launch command, include this override before attaching. A DAP port or socket alone does not enable core breakpoint checks and debugger-aware stepping. The override applies only to that launch and does not open GUI panes in the NoGUI build.
Launch/spawn configurations always use local TCP and clear a saved DAPSocket setting.
Normal launches allocate a port automatically; attach-with-spawn uses port.
host is used only for attaching to an existing server. Plain attach does not start
Dolphin or change its boot configuration. Configure its ELF, replacement mode,
source roots, and core debugging before connecting.
Options
dolphin: path todolphin-emu-nogui(DolphinNoGUI.exeon Windows).dolphin_gui: optional path to the Qt Dolphin executable.program: ELF, DOL, or ISO to boot.elf_file: ELF loaded for symbols and DWARF, and optionally executed in place of a disc's DOL.replace_disc_executable: defaults totrue, matching the VS Code plugin. Replace a booted disc's DOL withelf_file; setfalsefor metadata-only debugging, where ELF addresses must match the running executable. It also enables the disc bootstrap whenprogramis an ELF or DOL anddiscis set.disc: optional ISO mounted while directly executing an ELF or DOL.elf: deprecated alias forelf_fileretained for existing project files.source_paths: ordered directories used to locate source files; spawned Dolphin instances also receive them through the globalDolphin.Debug.SourcePathssetting.hostandport: TCP attach address, defaulting to127.0.0.1:5678.socket: Unix socket path for local attach.platform: NoGUI platform (x11,win32,macos, orheadless, as supported by your build).autoorvideoselects the OS default. Qt configurations omit this flag.entrypoints: optional existingentrypoints.jsonsidecar; otherwise the plugin looks beside the debug ELF. Passed through the supported--debug-entrypointsflag.enable_cheats: whether saved cheats are enabled for this launch.cwd: optional Dolphin working directory.
Use absolute paths (or ~ paths, which the plugin expands) for the executable,
game, ELF, and source roots. cwd changes Dolphin's working directory, not the
base used to expand paths in Neovim.
The plugin uses Dolphin.Debug.ELFFile, Dolphin.Debug.ReplaceDiscExecutable, and
Dolphin.Debug.SourcePaths. It does not use the removed DwarfElf or
BootExecutableWithDefaultDisc settings. These launch overrides are not persisted.
See the Dolphin DAP server documentation for build commands, server settings, and DWARF limitations.