How do I list the current line in python PDB? How do I list the current line in python PDB? python python

How do I list the current line in python PDB?


Late but hopefully still helpful. Make the following alias:

alias ll u;;d;;l

Then whenever you type ll, pdb will list from the current position. It works by going up the stack and then down the stack, which resets 'l' to show from the current position. (This won't work if you are at the top of the stack trace.)

Tip: Permanent alias

To make the alias permanent, add the line into your .pdbrc-file in the user home directory (~/.pdbrc). This works with both pdb and ipdb.


In Python 3.2 and higher, you can use list . to reset the list location.

Source: Python Bug tracker #4179


This question is 7 years old now..

If there’s anyone who are curious about this problem, just use the dot

(pdb) l .

This now works.