[Fix #365] not in scope error for getClosureData crashes debugger - #368
Conversation
646b930 to
a2e2a0b
Compare
guard on .Legacy module in .cabal now matches `#if MIN_VERSION_ghc(9,14,2)` check in code
1. `liftDebuggerOrFail` converts `Left`s into `TermParserError` for local recovery.
2. `expectRight` throws new `NonFatalException`.
3. `debuggerThread` catches `NonFatalException`,
then sends `NonFatalError` as `Response` and keeps going.
4. `NonFatalError` leads to an error response without killing the debug session.
expectRight seems to be used for errors that can be survived (in parsers and so on),
so NonFatalException seems a good default.
cdcfd51 to
b45ffbc
Compare
alt-romes
left a comment
There was a problem hiding this comment.
Yes, I like the overall approach moving less thing from hardcoded strings into just a module which is compiled and loaded at runtime all at once.
I just did a first quick pass, I'll need to look again better.
|
IIRC you previously introduced an in-memory-"FFI"-module. Could that be merged into this one perhaps? Could we make somehow the distinction between a module that is used for the compilation of the debugger vs a module used only at runtime? There is also one module which I think is all specified as a string or something which is also loaded at runtime. Or is just listed in |
b45ffbc to
2f90a5e
Compare
|
I don't really see "competing methods", tbf. The contents of all the modules you mentioned are bound to a StringBuffer CAF each via TH at compile time (the haskell-debugger-view ones need to be in extra-source-dirs so the files are in the haskell-debugger's sdist). If you prefer, what we can do is have one module that exports all the things from The haskell-debugger-view in-memory unit has to stay separate though, because that one depends on the debuggee units (both as home unit dependencies and whether we load it or not). More details on how things are used atm:
|
alt-romes
left a comment
There was a problem hiding this comment.
Excellent work!
I've got a few comments on a few things, but it's almost ready to land. Minimal changes needed.
2f90a5e to
80d8698
Compare
References to external packages and injected code in general are fragile if compiled using the `interactiveGhcDebugger` unit, which depends on all the debuggee ones. See Note [debuggerInternal unit] for how to use it to mitigate the issues.
80d8698 to
5665d33
Compare
Fix #365.
TODO: