Reputation: 8728
The Python 2.7 debugger pdb
allows to display lines o
to p
with l [o[,p]]
, but one has to figure out which line the debugger stand on and then substract and add. Is there a way to display an m
lines before and n
lines after the current line without arithmetics?
Upvotes: 4
Views: 1959
Reputation: 968
As far as I know, no. The l(ist)
command will display 11 lines around the current line, but you can't display m
lines before and n
after the current line.
https://docs.python.org/2/library/pdb.html
l(ist) [first[, last]] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With one argument, list 11 lines around at that line. With two arguments, list the given range; if the second argument is less than the first, it is interpreted as a count.
Upvotes: 2