summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-18 09:27:53 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-18 09:30:20 -0500
commit27b1034cde62a97a7d41714d58ef3f90be4e0997 (patch)
treec15269b5c20a52142c54f33124a07705c5ce09e6
parentb00741030596f921486ea98a4956ff79a8caac1c (diff)
downloadhaskell-wip/exec-stack-on-error.tar.gz
base: Shoe execution stack on error callswip/exec-stack-on-error
-rw-r--r--libraries/base/GHC/Exception.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs
index 3b32e230e8..ec564be016 100644
--- a/libraries/base/GHC/Exception.hs
+++ b/libraries/base/GHC/Exception.hs
@@ -77,10 +77,12 @@ errorCallException s = toException (ErrorCall s)
errorCallWithCallStackException :: String -> CallStack -> SomeException
errorCallWithCallStackException s stk = unsafeDupablePerformIO $ do
ccsStack <- currentCallStack
+ execStack <- ExecutionStack.showStackTrace
let
implicitParamCallStack = prettyCallStackLines stk
ccsCallStack = showCCSStack ccsStack
- stack = intercalate "\n" $ implicitParamCallStack ++ ccsCallStack
+ stack = intercalate "\n"
+ $ implicitParamCallStack ++ ccsCallStack ++ [ "Execution Stack:" ] ++ execStack
return $ toException (ErrorCallWithLocation s stack)
showCCSStack :: [String] -> [String]