Fix #8487: Debugger confuses variables
authorRoland Senn <rsx@bluewin.ch>
Thu, 18 Jul 2019 08:41:44 +0000 (10:41 +0200)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Sun, 21 Jul 2019 09:04:17 +0000 (05:04 -0400)
commit32be44613fed3fa7bff7190381acbdaa8ea15cfc
tree5c2c2fcadafb1d26386acba9d8ffe7d5ea7db256
parent67ee741bd6a7017a62719c3c25a5447a0b03191e
Fix #8487: Debugger confuses variables

To display the free variables for a single breakpoint, GHCi pulls out the
information from the fields `modBreaks_breakInfo` and `modBreaks_vars`
of the `ModBreaks` data structure. For a specific breakpoint this gives 2
lists of types 'Id` (`Var`) and `OccName`. They are used to create the Id's
for the free variables and must be kept in sync:
If we remove an element from the Names list, then we also must remove the
corresponding element from the OccNames list.
compiler/ghci/ByteCodeGen.hs
compiler/ghci/ByteCodeTypes.hs
compiler/main/InteractiveEval.hs
testsuite/tests/ghci.debugger/scripts/T8487.hs [new file with mode: 0644]
testsuite/tests/ghci.debugger/scripts/T8487.script [new file with mode: 0644]
testsuite/tests/ghci.debugger/scripts/T8487.stdout [new file with mode: 0644]
testsuite/tests/ghci.debugger/scripts/all.T