:history doesn't work if :trace is not used initially
With this q.hs
:
main :: IO ()
main = error "foo"
if I :trace main
then :history
works:
$ ghci -v0 -fbreak-on-exception q.hs
*Main> :trace main
Stopped at <exception thrown>
_exception :: e = GHC.IOBase.ErrorCall ('f' : _)
[<exception thrown>] *Main> :history
-1 : main (q.hs:3:7-17)
<end of history>
[<exception thrown>] *Main> :q
but if I first do just main
first then it doesn't work:
$ ghci -v0 -fbreak-on-exception q.hs
*Main> main
Stopped at <exception thrown>
_exception :: e = GHC.IOBase.ErrorCall ('f' : _)
[<exception thrown>] *Main> :history
Empty history. Perhaps you forgot to use :trace?
[<exception thrown>] *Main> :trace main
Stopped at <exception thrown>
_exception :: e = GHC.IOBase.ErrorCall ('f' : _)
... [<exception thrown>] *Main> :history
Empty history. Perhaps you forgot to use :trace?
... [<exception thrown>] *Main>
I assume that this isn't intentional, but confusion in which direction the history stack grows or something.
This happens in 6.8.2, 6.8 branch and HEAD.
The code in this patch:
Fri Jan 18 22:56:55 GMT 2008 Ian Lynagh <igloo@earth.li>
* Improve the error when :list can't find any code to show
duplicates the problem when deciding whether or not to tell the user to rerun with :trace
.
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |