Summary
A go launch never reports exitCode. Delve's DAP sends terminated but no exited event; the status arrives only as a console output line:
Process 26436 has exited with status 0
so list_debug_sessions and the start_debugging run-to-completion summary (data.exitCode) show nothing for go, in debug mode and under noDebug alike (measured while working #746 on examples/go/hello_world.go; python and cpp report exitCode: 0 on the same shape of run). A caller reading exitCode to tell a crash from a clean exit gets undefined on go.
What would help
The #258 adapter-exit synthesis exists for rdbg (adapterExitCodeIsDebuggeeExitCode). For Delve the debuggee's status is in the console line, not the adapter's exit code; a policy hook that parses Process \d+ has exited with status (\d+) from the console output and synthesizes the DAP exited event before terminated is forwarded would give go the same exitCode as the other adapters. docs/tool-reference.md currently says the exit code is reported "where the adapter reports one", which is accurate but is a gap worth closing.
Refs #258, #746.
Summary
A go launch never reports
exitCode. Delve's DAP sendsterminatedbut noexitedevent; the status arrives only as a console output line:so
list_debug_sessionsand thestart_debuggingrun-to-completion summary (data.exitCode) show nothing for go, in debug mode and undernoDebugalike (measured while working #746 onexamples/go/hello_world.go; python and cpp reportexitCode: 0on the same shape of run). A caller readingexitCodeto tell a crash from a clean exit getsundefinedon go.What would help
The #258 adapter-exit synthesis exists for rdbg (
adapterExitCodeIsDebuggeeExitCode). For Delve the debuggee's status is in the console line, not the adapter's exit code; a policy hook that parsesProcess \d+ has exited with status (\d+)from the console output and synthesizes the DAPexitedevent beforeterminatedis forwarded would give go the sameexitCodeas the other adapters.docs/tool-reference.mdcurrently says the exit code is reported "where the adapter reports one", which is accurate but is a gap worth closing.Refs #258, #746.