Skip to content

go: exitCode is never reported — Delve sends no exited event, only a console line #753

Description

@debugmcpdev

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions