Hi all

As you may know, this project was accepted for Google SoC and work started a 
few weeks ago. There are now some observable results that can be tested, and 
I have set up a wiki page at:
http://haskell.org/haskellwiki/Ghci/Debugger

As we are now approaching the less clear parts of the project your 
impressions and ideas (either extense designs or small pointers) are very 
welcome. The designs for dynamic breakpoints and call traces are open issues 
yet.

Cheers
Pepe


"Lemmih" <[EMAIL PROTECTED]> escribió en el mensaje 
news:[EMAIL PROTECTED]
Greetings,

A few days ago I wondered whether it would be possible to call GHCi
from interpreted byte-code. It turned out that it was, and it was even
fairly easy. Here's a preliminary result:

Test.lhs:
> import GHC.Base
> run :: Int -> ()
> run i
>     = let b = False
>           c x = x + a + i
>       in breakPoint ()
>       where d = "str"
>             a = 10
> runIO :: IO String
> runIO = do putStr "Enter line: "
>            line1 <- getLine
>            breakPoint $ do
>            putStr "Enter another line: "
>            line2 <- getLine
>            return (unwords [line1,line2])


Output from a GHCi session:

ghc/compiler/stage2/ghc-inplace --interactive Test.lhs -v0
*Main> run 100
Local bindings in scope:
  a :: Int, c :: Int -> Int, b :: Bool, i :: Int, d :: [Char]
Test.lhs:6> (a, b, c 10, d)
(10,False,120,"str")
Test.lhs:6> :q
Returning to normal execution...
()
*Main> runIO
Enter line: Hello
Local bindings in scope:
  line1 :: String
Test.lhs:12> map Char.toUpper line1
"HELLO"
Test.lhs:12> :q
Returning to normal execution...
Enter another line: World
"Hello World"
*Main> :q

Note that the problems with the representation of variables and their
laziness has been delegated to the user. Has this approach been tried
before?

Simon PJ: You mentioned something about some ideas for building a
debugger into GHCi in your call for interns two months ago. Care to
elaborate on those or can I perhaps reach them online?

--
Friendly,
  Lemmih 



_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to