Actually GHC does exactly that when you compile with -prof -auto-all. Then if you run with +RTS -xc, you get a backtrace of sorts. (I have not tested this recently!) The backtrace is not yet reified into a data structure that can be examined, but that'd be quite doable if someone wanted to try.
The downside is that -prof makes many optimisations work less well, and all modules must be compiled this way. Simon | -----Original Message----- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of MR | K P SCHUPKE | Sent: 01 October 2004 18:29 | To: [EMAIL PROTECTED]; [EMAIL PROTECTED] | Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] | Subject: Re: [Haskell-cafe] Exceptions | | >But, being able to see the context in which a thunk was constructed would be | >extremely useful. | | Yes of course... I was thinking along the lines of what is possible, rather | than what is desirable. If only ghc had a -g (debug) flag like gcc that would | force each funtion to push its entry onto some kind of call stack that would | be returned by exceptions... | | Keean. | _______________________________________________ | Haskell-Cafe mailing list | [EMAIL PROTECTED] | http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe