Issue 30761: pdb: Add step / next count arguments (original) (raw)

Created on 2017-06-26 10:10 by louielu, last changed 2022-04-11 14:58 by admin.

Pull Requests
URL Status Linked Edit
PR 2399 open louielu,2017-06-26 10:12
Messages (4)
msg296869 - (view) Author: Louie Lu (louielu) * Date: 2017-06-26 10:10
This propose to add *count* times on step and next instruction in pdb. step [count] next [count] User can use `next [count]` to run next *count* times, or `step [count]` to run step *count* times, until it countdown, or occure a breakpoint. Similar function has been implemented in gdb[1] before. [1]: https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html
msg296871 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-26 10:14
@Xavier: Would you mind to review this enhancement? Thanks.
msg296906 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-06-26 15:20
Thanks for this PR Louie, adding count to the pdb commands is useful. With gdb a very common use case is to set a breakpoint where the code runs very frequently and when only interested in the N(th) execution of this code, to enter the breakpoint command list: (gdb) commands Type commands for breakpoint(s) 1, one per line. End with a line saying just "end". >silent >continue <N - 1> >end (gdb) PR 2399 does not handle this case for pdb: * The 'count' option for the 'continue' command is not implemented. * The implementation of the 'count' option for 'next' and 'step' does not handle breakpoint command lists (I think). IMO it is difficult to handle this option for breakpoint command lists directly in pdb.py, but it could be done in bdb.py, adding a keyword argument to set_continue() et al.
msg296930 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-06-26 18:42
FWIW, I've never needed this ever.
History
Date User Action Args
2022-04-11 14:58:48 admin set github: 74946
2017-08-26 19:29:59 barry set nosy: + barry
2017-06-26 18:42:27 rhettinger set nosy: + rhettingermessages: +
2017-06-26 15:20:29 xdegaye set messages: +
2017-06-26 10:14:07 vstinner set nosy: + xdegaye, vstinnermessages: +
2017-06-26 10:12:00 louielu set pull_requests: + <pull%5Frequest2446>
2017-06-26 10:10:13 louielu create