Make 'error' include the CCS call stack when profiled
authorSimon Marlow <marlowsd@gmail.com>
Tue, 3 Nov 2015 14:06:09 +0000 (14:06 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 13 Nov 2015 16:06:42 +0000 (16:06 +0000)
commit8988be8561ce0857f3befd6ab3b6c29060685c0a
tree88848de1dd8bc6664fd0de65f9b04415a4b4cc67
parent8868ff3eb742977c5de2609f7d748f4ff8882d6d
Make 'error' include the CCS call stack when profiled

Summary:
The idea here is that this gives a more detailed stack trace in two
cases:

1. With `-prof` and `-fprof-auto`
2. In GHCi (see #11047)

Example, with an error inserted in nofib/shootout/binary-trees:

```
$ ./Main 3
Main: z
CallStack (from ImplicitParams):
  error, called at Main.hs:67:29 in main:Main
CallStack (from -prof):
  Main.check' (Main.hs:(67,1)-(68,82))
  Main.check (Main.hs:63:1-21)
  Main.stretch (Main.hs:32:35-57)
  Main.main.c (Main.hs:32:9-57)
  Main.main (Main.hs:(27,1)-(43,42))
  Main.CAF (<entire-module>)
```

This doesn't quite obsolete +RTS -xc, which also attempts to display
more information in the case when the error is in a CAF, but I'm
exploring other solutions to that.

Includes submodule updates.

Test Plan: validate

Reviewers: simonpj, ezyang, gridaphobe, bgamari, hvr, austin

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1426
48 files changed:
libraries/array
libraries/base/GHC/Exception.hs
libraries/base/GHC/IO.hs
libraries/base/GHC/IO/Unsafe.hs [new file with mode: 0644]
libraries/base/GHC/Stack.hs [new file with mode: 0644]
libraries/base/GHC/Stack.hsc
libraries/base/GHC/Stack/CCS.hs-boot [new file with mode: 0644]
libraries/base/GHC/Stack/CCS.hsc [new file with mode: 0644]
libraries/base/base.cabal
libraries/base/tests/assert.stderr
libraries/base/tests/readFloat.stderr
libraries/hpc
libraries/stm
testsuite/tests/annotations/should_fail/annfail12.stderr
testsuite/tests/array/should_run/arr003.stderr
testsuite/tests/array/should_run/arr004.stderr
testsuite/tests/array/should_run/arr007.stderr
testsuite/tests/array/should_run/arr008.stderr
testsuite/tests/codeGen/should_run/T5626.stderr
testsuite/tests/codeGen/should_run/cgrun016.stderr
testsuite/tests/codeGen/should_run/cgrun045.stderr
testsuite/tests/codeGen/should_run/cgrun051.stderr
testsuite/tests/codeGen/should_run/cgrun059.stderr
testsuite/tests/concurrent/should_run/conc021.stderr
testsuite/tests/deriving/should_run/T5628.stderr
testsuite/tests/driver/sigof02/sigof02.stderr
testsuite/tests/driver/sigof02/sigof02m.stderr
testsuite/tests/ffi/should_run/ffi008.stderr
testsuite/tests/ffi/should_run/fptrfail01.stderr
testsuite/tests/ghc-e/should_run/ghc-e005.stderr
testsuite/tests/ghci.debugger/scripts/break009.stdout
testsuite/tests/ghci.debugger/scripts/break011.stdout
testsuite/tests/ghci.debugger/scripts/break017.stdout
testsuite/tests/ghci/scripts/T10501.stderr
testsuite/tests/ghci/scripts/T5557.stdout
testsuite/tests/ghci/scripts/ghci055.stdout
testsuite/tests/profiling/should_run/ioprof.stderr
testsuite/tests/safeHaskell/safeLanguage/SafeLang09.stderr
testsuite/tests/simplCore/should_fail/T7411.stderr
testsuite/tests/simplCore/should_run/T457.stderr
testsuite/tests/simplCore/should_run/T5587.stderr
testsuite/tests/simplCore/should_run/T5625.stderr
testsuite/tests/stranal/should_run/strun002.stderr
testsuite/tests/th/T5358.stderr
testsuite/tests/th/T5976.stderr
testsuite/tests/th/T8987.stderr
testsuite/tests/th/TH_exn2.stderr
testsuite/tests/typecheck/should_run/IPLocation.stdout