[Git][ghc/ghc][wip/romes/exceptions-propagate] 5 commits: Remove redundant CallStack from exceptions
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Wed Oct 2 10:41:39 UTC 2024
Rodrigo Mesquita pushed to branch wip/romes/exceptions-propagate at Glasgow Haskell Compiler / GHC
Commits:
dce7af67 by Rodrigo Mesquita at 2024-10-02T11:34:31+01:00
Remove redundant CallStack from exceptions
Before the exception backtraces proposal was implemented, ErrorCall
accumulated its own callstack via HasCallStack constraints, but
ExceptionContext is now accumulated automatically.
The original ErrorCall mechanism is now redundant and we get a duplicate
CallStack
Updates Cabal submodule to fix their usage of ErrorCallWithLocation to ErrorCall
CLC proposal#285
Fixes #25283
- - - - -
0f108aa3 by Rodrigo Mesquita at 2024-10-02T11:35:37+01:00
Freeze call stack in error throwing functions
CLC proposal#285
- - - - -
819a4208 by Rodrigo Mesquita at 2024-10-02T11:41:17+01:00
De-duplicate displayContext and displayExceptionContext
The former was unused except for one module where it was essentially
re-defining displayExceptionContext.
Moreover, this commit extends the fix from
bfe600f5bb3ecd2c8fa71c536c63d3c46984e3f8 to displayExceptionContext too,
which was missing.
- - - - -
c5db7e20 by Rodrigo Mesquita at 2024-10-02T11:41:17+01:00
Re-export NoBacktrace from Control.Exception
This was originally proposed and accepted in section
"2.7 Capturing Backtraces on Exceptions"
of the CLC proposal for exception backtraces.
However, the implementation missed this re-export, which this commit now
fixes.
- - - - -
e807846d by Rodrigo Mesquita at 2024-10-02T11:41:17+01:00
Fix exception backtraces from GHCi
When running the program with `runhaskell`/`runghc` the backtrace should
match the backtrace one would get by compiling and running the program.
But currently, an exception thrown in a program interpreted with
`runhaskell` will:
* Not include the original exception backtrace at all
* Include the backtrace from the internal GHCi/ghc rethrowing of the
original exception
This commit fixes this divergence by not annotating the ghc(i) backtrace
(with NoBacktrace) and making sure that the backtrace of the original
exception is serialized across the boundary and rethrown with the
appropriate context.
Fixes #25116
- - - - -
30 changed files:
- compiler/GHC/Utils/Panic/Plain.hs
- ghc/GHCi/UI/Monad.hs
- libraries/Cabal
- libraries/base/src/Control/Exception.hs
- libraries/base/src/GHC/Exception.hs
- libraries/base/src/GHC/Stack.hs
- libraries/base/tests/IO/T4808.stderr
- libraries/base/tests/IO/mkdirExists.stderr
- libraries/base/tests/IO/openFile002.stderr
- libraries/base/tests/IO/withBinaryFile001.stderr
- libraries/base/tests/IO/withFile001.stderr
- libraries/base/tests/IO/withFileBlocking001.stderr
- libraries/base/tests/T15349.stderr
- libraries/base/tests/T19288.stderr
- libraries/base/tests/T24807.stderr
- libraries/base/tests/all.T
- libraries/base/tests/assert.stderr
- − libraries/base/tests/topHandler04.hs
- − libraries/base/tests/topHandler04.stderr
- libraries/ghc-internal/src/GHC/Internal/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- libraries/ghc-internal/src/GHC/Internal/IO.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Stack.hs
- libraries/ghc-internal/src/GHC/Internal/Stack.hs-boot
- − libraries/ghc-internal/src/GHC/Internal/Stack/CCS.hs-boot
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- testsuite/tests/annotations/should_fail/annfail12.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0ece32881a3dd78d364d6c2ae325388a2c44152f...e807846d49e0c9a8ae69d93ad4d0eca882b4fba8
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0ece32881a3dd78d364d6c2ae325388a2c44152f...e807846d49e0c9a8ae69d93ad4d0eca882b4fba8
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241002/1e07c756/attachment.html>
More information about the ghc-commits
mailing list