Make it easier to print stack traces when debugging GHC itself
As suggested in the mailing list, GHC should have better support for printing its own stack trace when profiling is enabled.
This ticket is to track progress toward this goal.
There are a few moving parts:
- Just having
pprTraceusetraceStackis a bad idea, because a profiled compiler will spew lots and lots and lots of output. Instead, I propose a newpprTraceStack :: String -> SDoc -> a -> a. - Currently,
ASSERTwill print a stack trace, but it's sometimes the wrong one.ASSERTthrows an error; if this error is caught and re-thrown, the stack trace is at the re-throw. Instead, it should be at the origin. - Is it worth adding a new mode in
build.mkthat enables profiling,DEBUG, and-fprof-auto, just to get good stack traces?
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.10.1 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |