X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fghci.xml;h=0142e1eb8b8fc15dc4346a03e1bf000ca7cb1e7b;hb=f94f26a7cb7bb7005b88f50c4383a761fc18718d;hp=94d352b9f7b1ea006e533274bee6cb7bfe49e6d3;hpb=c3e1f7be52fbe5d13a7ee733b99ef6e73762e5ab;p=ghc-hetmet.git
diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml
index 94d352b..0142e1e 100644
--- a/docs/users_guide/ghci.xml
+++ b/docs/users_guide/ghci.xml
@@ -906,7 +906,7 @@ $ ghci -lm
- :breakpoint list|add|del|stop|step ...
+ :breakpoint list|add|continue|del|stop|step ...
:breakpoint
@@ -963,6 +963,15 @@ $ ghci -lm
+ :continue
+ :continue
+
+ Shortcut to :breakpoint continue
+
+
+
+
+
:def name expr
:def
@@ -1556,7 +1565,7 @@ Prelude> :set -fno-glasgow-exts
in the context of the event, as well as evaluate arbitrary Haskell expressions in
a special interactive prompt.
- When you are done you issue the :quit
+ When you are done you issue the :continue
command to leave the breakpoint and let the execution go on.
Note that not all the GHCi commands are supported in a breakpoint.
@@ -1641,6 +1650,7 @@ qsort2.hs:2:15-46>
type to do its work.
Let's go on with the debugging session of the qsort
example:
+A short debugging session
qsort2.hs:2:15-46> x
This is an untyped, unevaluated computation. You can use seq to
@@ -1658,7 +1668,7 @@ x - 10
qsort2.hs:2:15-46> :t x
x :: Int
-
+
GHCi reminds us that this value is untyped, and instructs us to force its evaluation
@@ -1705,6 +1715,26 @@ x :: Int
at line line in module, if any.
+
+
+
+ :breakpoint continue
+
+
+ When at a breakpoint, continue execution up to the next breakpoint
+ or end of evaluation.
+
+
+
+
+
+ :continue
+
+
+ Shortcut for :breakpoint continue
+
+
+
:breakpoint list
@@ -1767,7 +1797,44 @@ x :: Int
-
+ Tips
+
+ * Use PRAGMAs to fine tune which modules are loaded under debugging mode
+
+ {-# OPTIONS_GHC -fdebugging #-}
+
+
+ * Repeated use of seq
and
+ :print may be necessary to observe unevaluated
+ untyped bindings
+ see
+
+
+ * GHC.Exts.unsafeCoerce
can help if you are positive about the type of a binding
+
+type MyLongType a = [Maybe [Maybe a]]
+
+main:Main> :m +GHC.Exts
+main:Main> main
+Local bindings in scope:
+ x :: a
+Main.hs:15> let x' = unsafeCoerce x :: MyLongType Bool
+Main.hs:15> x'
+[Just [Just False, Just True]]
+
+ Note that a wrong coercion will likely result in your debugging session being interrupted by a segmentation fault
+
+
+ * The undocumented (and unsupported) :force command
+
+ equivalent to :print with automatic
+ seq
forcing,
+ may prove useful to replace sequences of seq
and
+ :print in some situations.
+
+
+
+
The .ghci file
.ghcifile