@@ -10,22 +10,67 @@ Execute the current line, stopping at the next event.
1010
1111With an integer argument, step that many times.
1212
13- *event * is list of an event name which is one of: `call `,
14- `return `, `line `, `exception ` `c-call `, `c-return ` or `c-exception `.
13+ *event * is list of an event name which is one of: ``call ``,
14+ ``return ``, ``line ``, ``exception ``, ``c-call ``, ``c-return ``, or ``c-exception ``.
15+
16+
1517If specified, only those stepping events will be considered. If no
1618list of event names is given, then any event triggers a stop when the
17- count is 0 .
19+ count is zero .
1820
19- There is however another way to specify a *single * event, by
20- suffixing one of the symbols `< `, `> `, or `! ` after the command or on
21- an alias of that. A suffix of `+ ` on a command or an alias forces a
22- move to another line, while a suffix of `- ` disables this requirement.
23- A suffix of `> ` will continue until the next call. (`finish ` will run
24- run until the return for that call.)
21+ There is however another way to specify an event: you can suffix one
22+ of the symbols ``< ``, ``> ``, or ``! `` after the command or on an alias
23+ of that. A suffix of ``+ `` on a command or an alias forces a move to
24+ another line, while a suffix of ``- `` disables this requirement. A
25+ suffix of ``> `` will continue until the next call. ``finish `` will run
26+ run until the return for that call, in contrast to ``step< `` continues to the
27+ return of *any * call which might occur inside a nested call.
2528
26- If no suffix is given, the debugger setting `different-line `
29+ If no suffix is given, the debugger setting `` different-line ` `
2730determines this behavior.
2831
32+ An example. Use ``step> `` to skip over a number of statements to get a call that is coming up:
33+
34+ ::
35+
36+ (trepan3k) list
37+ 29 # Make: a <= b
38+ 30 if a > b:
39+ 31 (a, b) = (b, a)
40+ 32 pass
41+ 33
42+ 34 --> if a <= 0:
43+ 35 return None
44+ 36 if a == 1 or b-a == 0:
45+ 37 return a
46+ 38 return gcd(b-a, a)
47+
48+ If we know that ``a >=1 and b != 0 ``, then by running ``step> `` we will
49+ skip over all of the testing and proceed into the ``gcd() `` call:
50+
51+ ::
52+
53+ (trepan3k) step>
54+ (/tmp/python3-trepan/test/example/gcd.py:26): gcd
55+ -> 26 def gcd(a,b):
56+ a = 3
57+ b = 3
58+ (trepan3k)
59+
60+ Now if we want to continue execution to the return, run ``step< ``:
61+
62+ ::
63+
64+ (trepan3k) step<
65+ step<
66+ (/tmp/python3-trepan/test/example/gcd.py:37 @62): gcd
67+ <- 37 return a
68+ R=> 3
69+
70+ Note that ``finish `` does the same thing as ``step< `` and might even be more reliable here.
71+
72+ For ``step> ``, ``break `` is sometimes better.
73+
2974Step Examples:
3075++++++++++++++
3176
0 commit comments