Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

IPE source location is wrong for continuation frame
## Summary In the debugger, I've got a test which now fails because of a behavior that changed in GHC wrt the source location that is used for the IPE information. We used to pick a source-relevant source location to put in the IPE info, but now we seem to use the source location of something inlined from a different library. I think the new behavior is incorrect. Specifically, I have a package `b` with: ```haskell thenDo :: (String -> IO String) -> String -> IO () thenDo a b = do print =<< a ("test" ++ b) {-# OPAQUE thenDo #-} ``` And a home package `a` which imports that module from `b`, sets a breakpoint on the `a x = do` line below, and calls `thenDo` on it: ```haskell main :: IO () main = a `thenDo` ("before" ++ "OK ") where a x = do putStrLn x pure (x++"hi2b") ``` At the source level, it makes sense to think, while stopped in `a`, the stack will contain a continuation frame for `thenDo` which the result of `a` will be returned to. Decoding the stack with IPE on 9.14 does yield this: a stack frame called `thenDo`. However, with HEAD, I get a stack frame called `bindIO` instead. This can make some sense when you look at the Core, because `a` is evaluated as the first argument to `>>=` (which is inlined into the definition of `thenDo`) But that's no good when you want to reason about the source program! If I dump-cmm this module with 9.14 and 10.2 we see the difference clearly in the ticks. In 9.14 we only have one tick `thenDo` for the continuation frame, but in 10.2 we have tons of ticks. The problem seems to be we now use the (innermost) `bindIO` tick in the IPE info instead of the (source relevant) `thenDo` tick. 9.14: ```c //tick src<src/MyLib.hs:(5,1)-(6,27)> I64[Hp - 16] = thenDo_sat_s129_info; P64[Hp] = _s127::P64; ``` 10.2 ```c //tick src<libraries/ghc-internal/src/GHC/Internal/Base.hs:2343:5-22> //tick src<libraries/ghc-internal/src/GHC/Internal/Base.hs:1421:1-25> //tick src<src/MyLib.hs:(5,1)-(6,27)> //tick src<libraries/ghc-internal/src/GHC/Internal/Base.hs:2363:1-76> I64[Hp - 16] = thenDo_sat_tOA_info; P64[Hp] = _tOy::P64; I64[Sp - 8] = cOT; ``` And I guess the innermost is the one attributed to the IPE info. Note: `Base.hs:2363` is `bindIO` which is the call to `>>=` in the unfolding of `thenDo`. ## Steps to reproduce I don't know what is the best way to observe from the compiler output what IPE info gets assigned to each frame. My reproducer relies on using the debugger because it already contains the code for cloning and decoding the stack of a thread which is currently stopped at a breakpoint. The reproducer code is in https://github.com/well-typed/haskell-debugger/tree/master/test/integration/T107a. It purposefully contains two packages, where `b` is meant to be compiled and `a` meant to be interpreted (so that you can set breakpoints in `a` and get IPE info on `b` code). you can get up to the breakpoint by doing ``` $ cabal repl > :break 9 > main ``` but then you'd need some way of decoding the stack of the thread which is stopped at the breakpoint to tell the frames. I'm sure there's an easier way to do this ## Expected behavior I think the source location in the IPE info associated to the frame pushed for the `thenDo` continuation should be `MyLib:thenDo`, not `Base:bindIO` ## Environment * GHC version used: HEAD Optional: * Operating System: * System Architecture:
issue