Skip to content

[Fix #266] Add InterpreterSettings/DAPDebuggee interface#338

Open
Saizan wants to merge 1 commit into
masterfrom
issue266
Open

[Fix #266] Add InterpreterSettings/DAPDebuggee interface#338
Saizan wants to merge 1 commit into
masterfrom
issue266

Conversation

@Saizan

@Saizan Saizan commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

The second part of #266: the different ways of running a debuggee are now handled uniformly through an API that they all implement.

Everything to do with the runInTerminal feature is DAP specific, so we ended up with two abstractions rather than one:

  • InterpreterSettings tells you what top-level DynFlags to set, and how to setup the GHC interpreter.
  • DAPDebuggee: contains InterpreterSettings but also extra debug session threads, post-action (to send runInTerminal request), and a method to wait for the debuggee to be ready.

hdb cli only uses the InterpreterSettings abstraction, while the hdb server uses DAPDebugee (c.f. initDebugger).

We now throw an exception when we realize -f[no-]external-interpreter has been set in a way inconsistent with hdb's own flags.

Some code was found to be dead and removed.

Sockets opened to find an open port are kept open and used for the server, so we avoid a race condition on which session gets to use the port (though probably hard to trigger).

@Saizan Saizan changed the title Issue266 [Fix #266] Add InterpreterSettings/DAPDebuggee interface Jul 9, 2026
@Saizan Saizan force-pushed the issue266 branch 3 times, most recently from 91ea119 to c6d893b Compare July 10, 2026 12:37
@Saizan Saizan marked this pull request as ready for review July 10, 2026 13:03
@Saizan Saizan requested a review from alt-romes July 10, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactoring the runInTerminal vs external interpreter vs internal interpreter scenarios

1 participant