... | ... | @@ -6,7 +6,7 @@ This page documents the "finding the needle" idea for locating errors. It's a pr |
|
|
|
|
|
The basic idea is described below, but these links are actually more up to date:
|
|
|
|
|
|
- [ Finding the needle](http://research.microsoft.com/~simonpj/papers/stack-trace/DebugTraces.pdf), a paper describing Tristan Allwood's intern project to implement explicit call stacks in GHC (May 2009).
|
|
|
- [Finding the needle](http://research.microsoft.com/~simonpj/papers/stack-trace/DebugTraces.pdf), a paper describing Tristan Allwood's intern project to implement explicit call stacks in GHC (May 2009).
|
|
|
- [ExplicitCallStack/StackTraceExperience](explicit-call-stack/stack-trace-experience): Some tests done on real programs with various tools for displaying stack traces.
|
|
|
- [ExplicitCallStack/CorePassImplementation](explicit-call-stack/core-pass-implementation): MSR Internship Oct-Dec 2008 that provided a prototype implementation for this.
|
|
|
|
... | ... | @@ -31,7 +31,7 @@ The basic idea is described below, but these links are actually more up to date: |
|
|
|
|
|
This doesn't quite work today because `loc` has type `Language.Haskell.TH.Syntax.Loc`, a record of location information, and that isn't an instance of `Lift` (yet). But the idea is basically fine: TH gives you access to the current source location.
|
|
|
|
|
|
1. But that doesn't help with 'head'. We want to pass head's *call site* to head. That's what jhc does when you give 'head' the a magic [ SRCLOC_ANNOTATE pragma](http://repetae.net/computer/jhc/jhc.shtml):
|
|
|
1. But that doesn't help with 'head'. We want to pass head's *call site* to head. That's what jhc does when you give 'head' the a magic [SRCLOC_ANNOTATE pragma](http://repetae.net/computer/jhc/jhc.shtml):
|
|
|
|
|
|
- every call to `head` gets replaced with `head_check $currentLocation`
|
|
|
- in jhc, you get to write `head_check` yourself, with type
|
... | ... | |