summaryrefslogtreecommitdiff
path: root/docs/users_guide/ghci.rst
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2021-01-16 17:31:45 +0100
committerBen Gamari <ben@smart-cactus.org>2021-03-10 16:59:05 -0500
commitfcfc66e59c81277c1f7c079ad4e0ccd9a69e1fb6 (patch)
tree378b6b8bebea928fe5fafad2dcf7920253ecbaeb /docs/users_guide/ghci.rst
parent115cd3c85a8c38f1fe2a10d4ee515f92c96dd5a2 (diff)
downloadhaskell-fcfc66e59c81277c1f7c079ad4e0ccd9a69e1fb6.tar.gz
Ignore breakpoint for a specified number of iterations. (#19157)
* Implement new debugger command `:ignore` to set an `ignore count` for a specified breakpoint. * Allow new optional parameter on `:continue` command to set an `ignore count` for the current breakpoint. * In the Interpreter replace the current `Word8` BreakArray with an `Int` array. * Change semantics of values in `BreakArray` to: n < 0 : Breakpoint is disabled. n == 0 : Breakpoint is enabled. n > 0 : Breakpoint is enabled, but ignore next `n` iterations. * Rewrite `:enable`/`:disable` processing as a special case of `:ignore`. * Remove references to `BreakArray` from `ghc/UI.hs`.
Diffstat (limited to 'docs/users_guide/ghci.rst')
-rw-r--r--docs/users_guide/ghci.rst28
1 files changed, 24 insertions, 4 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
index ac9f33f362..5ffe323f5f 100644
--- a/docs/users_guide/ghci.rst
+++ b/docs/users_guide/ghci.rst
@@ -2347,10 +2347,14 @@ commonly used commands.
ghci> :complete repl 5-10 "map"
0 3 ""
-.. ghci-cmd:: :continue
+.. ghci-cmd:: :continue; [⟨ignoreCount⟩]
Continue the current evaluation, when stopped at a breakpoint.
+ If an ``⟨ignoreCount⟩`` is specified, the program will ignore
+ the current breakpoint for the next ``⟨ignoreCount⟩`` iterations.
+ See command :ghci-cmd:`:ignore`.
+
.. ghci-cmd:: :ctags; [⟨filename⟩]
Generates a "tags" file for Vi-style editors (:ghci-cmd:`:ctags`) or
@@ -2459,7 +2463,8 @@ commonly used commands.
Enable one or more disabled breakpoints by number (use :ghci-cmd:`:show breaks` to
see the number and state of each breakpoint). The ``*`` form enables all the
- disabled breakpoints.
+ disabled breakpoints. Enabling a break point will reset its ``ignore count``
+ to 0. (See :ghci-cmd:`:ignore`)
.. ghci-cmd:: :etags
@@ -2577,6 +2582,20 @@ commonly used commands.
current module if omitted). This includes the trust type of the
module and its containing package.
+.. ghci-cmd:: :ignore; ⟨break⟩ ⟨ignoreCount⟩
+
+ Set the ignore count of the breakpoint with number ``⟨break⟩`` to
+ ``⟨ignoreCount⟩``.
+
+ The next ``⟨ignoreCount⟩`` times the program hits the breakpoint
+ ``⟨break⟩``, this breakpoint is ignored and the program doesn't
+ stop. Every time the breakpoint is ignored, the ``ignore count``
+ is decremented by 1. When the ``ignore count`` is zero, the program
+ again stops at the break point.
+
+ You can also specify an ``⟨ignoreCount⟩`` on a :ghci-cmd:`:continue`
+ command when you resume execution of your program.
+
.. ghci-cmd:: :kind;[!] ⟨type⟩
Infers and prints the kind of ⟨type⟩. The latter can be an arbitrary
@@ -2866,8 +2885,9 @@ commonly used commands.
*ghci> :def cond \expr -> return (":cmd if (" ++ expr ++ ") then return \"\" else return \":continue\"")
*ghci> :set stop 0 :cond (x < 3)
- Ignoring breakpoints for a specified number of iterations is also
- possible using similar techniques.
+ To ignore breakpoints for a specified number of iterations use
+ the :ghci-cmd:`:ignore` or the ``⟨ignoreCount⟩`` parameter of the
+ :ghci-cmd:`:continue` command.
.. ghci-cmd:: :seti; [⟨option⟩ ...]