Skip to content

fix: Look for active breaks in right ModBreaks#298

Merged
alt-romes merged 4 commits intomasterfrom
wip/romes/297
Apr 28, 2026
Merged

fix: Look for active breaks in right ModBreaks#298
alt-romes merged 4 commits intomasterfrom
wip/romes/297

Conversation

@alt-romes
Copy link
Copy Markdown
Collaborator

In `getActiveBreakpoints`, we were incorrectly looking up the occurence
module of an internal breakpoint id (`getBreakSourceMod`) on the
`InternalModBreaks` of a different module (`readIModBreaksMaybe` of the
argument module, not the internal breakpoint id one)!

That is just plain incorrect...

The `activeBreakpoints` map stores the active internal-breakpoint-ids.
To get the active breakpoints at module A, we find the *occurrence
module* for every internal breakpoint id in `activeBreakpoints` and keep
the ones whose occurrence module matches the argument module (recall: a
breakpoint defined in B may be inlined in A, which means
`getBreakSourceMod` will return `A` -- and that's what we want to match
against the argument module)

(See also Note [ModBreaks vs InternalModBreaks] and Note [Breakpoint identifiers] in GHC)

Fixes #297

Helps when debugging the debugger!
In `getActiveBreakpoints`, we were incorrectly looking up the occurence
module of an internal breakpoint id (`getBreakSourceMod`) on the
`InternalModBreaks` of a different module (`readIModBreaksMaybe` of the
argument module, not the internal breakpoint id one)!

That is just plain incorrect...

The `activeBreakpoints` map stores the active internal-breakpoint-ids.
To get the active breakpoints at module A, we find the *occurrence
module* for every internal breakpoint id in `activeBreakpoints` and keep
the ones whose occurrence module matches the argument module (recall: a
breakpoint defined in B may be inlined in A, which means
`getBreakSourceMod` will return `A` -- and that's what we want to match
against the argument module)

(See also Note [ModBreaks vs InternalModBreaks] and Note [Breakpoint identifiers] in GHC)

Fixes #297
This output required updating everytime a module was added or removed,
as was very prone to conflict
@alt-romes alt-romes merged commit 1d84b81 into master Apr 28, 2026
5 checks passed
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.

Breakpoints are seemingly overwritten on setBreakpoints

1 participant