Skip to content

Terminated Event is not fired before disconnect #523

@oats4goats

Description

@oats4goats

Your environment

  • ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
  • rdbg -v: rdbg 1.4.0

Describe the bug
It looks like in Remote Debug mode (DAP client nvim-dap) after the last program step, the debugger disconnects but doesn't fire 'Terminated Event'. In such situation, DAP client doesn't know the debugging of the debuggee has terminated and keeps the debug session alive forever. Thus requiring manual treatment.

To Reproduce

  1. Start a debugger with rdbg --open --port 38698 target.rb in a terminal
  2. Attach to the adapter with nvim-dap
  3. Continue or step over till the very end of the program.
  4. The debugger in the terminal disconnects.

Example of console output:

#14867:[>] {"type":"request","seq":52,"arguments":{"granularity":"statement","threadId":1},"command":"next"}
#14867:[<] {"type":"response","command":"next","request_seq":52,"success":true,"message":"Success","seq":62}
12
DEBUGGER: Disconnected.

Expected behavior
Before the debugger disconnects 'Terminated Event' is issued so the client could close the debug session properly.

Additional context
Relevant discussion in mfussenegger/nvim-dap

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