Skip to content

Various changes needed for ghc-worker integration#321

Open
Saizan wants to merge 10 commits into
masterfrom
public-dap
Open

Various changes needed for ghc-worker integration#321
Saizan wants to merge 10 commits into
masterfrom
public-dap

Conversation

@Saizan

@Saizan Saizan commented May 28, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Saizan added 7 commits May 28, 2026 15:55
A debugRunner might not set any of the loaded modules
as targets, so we can't rely on those to ensure they are
included in the result by downsweep.

Then we do a downsweep only for the in-memory modules and manually
construct the union of the graphs.
@alt-romes

Copy link
Copy Markdown
Collaborator

Let me know once I should look. Cool!

@Saizan Saizan marked this pull request as ready for review June 19, 2026 12:38
@Saizan

Saizan commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

@alt-romes ready to review (prob. since before zurihac but forgot to ping)

@alt-romes alt-romes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just a few comments

Comment thread haskell-debugger/GHC/Debugger/Session.hs Outdated
Comment thread haskell-debugger/GHC/Debugger/Monad.hs Outdated
loadHomeUnit

fixHomeUnitsDynFlagsForIIDecl
GHC.modifySessionM $ liftIO . addInteractiveGhcDebuggerUnit

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this end up getting called twice? Once here, once in initHomeUnitEnv? Is this idempotent and/or expected?

Comment on lines +281 to +283
getModuleByPath path = do
-- get all loaded modules this every time as the loaded modules may have changed
lms <- getAllLoadedModules
lms <- mapM (\ m -> fmap (m,) . liftIO . makeAbsolute . msHsFilePath $ m) =<< getAllLoadedModules

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often is getModuleByPath called? I reckon pretty often. Maybe getAllLoadedModules absolute paths should be somehow cache?

Feels like it would be slightly cleaner if getAllLoadedModules (INVARIANT: returns normalized Absolute paths) had a cache

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not so often? Mostly when the dap-client queries or manipulates breakpoints.

Though now that I look at this again we should not makeAbsolute these paths, but rather use the workingDir from their units' DynFlags.

How would you invalidate a loadedModules :: [ModSummary] cache with patched paths though? Currently we only load modules in runDebugger I think, but I could see that changing.

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.

2 participants