[GHC] #2054: :history doesn't

GHC trac at galois.com
Sat Jan 19 07:58:19 EST 2008


#2054: :history doesn't
------------------------+---------------------------------------------------
    Reporter:  igloo    |       Owner:         
        Type:  bug      |      Status:  new    
    Priority:  normal   |   Milestone:  6.8.3  
   Component:  GHCi     |     Version:  6.8.2  
    Severity:  normal   |    Keywords:         
  Difficulty:  Unknown  |    Testcase:         
Architecture:  Unknown  |          Os:  Unknown
------------------------+---------------------------------------------------
 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 at 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`.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2054>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list