# Python : Core : Debugging
- [library/pdb](https://docs.python.org/3/library/pdb.html)
To invoke, either run:
```python
$ python -m pdb <input>
```
Or insert a breakpoint in the code and run it normally:
```python
breakpoint() # shortcut for: import pdb; pdb.set_trace()
```
| Command | Description |
| --------------------- | ------------------------------ |
| `list` | show code around currenty line |
| `step` | run next line (deep) |
| `next` | run next line (shallow) |
| `pp <var>` | pretty-print variable |
| `break` | list breakpoints |
| `break <file>:<line>` | set breakpoint |
| `continue` | run until next breakpoint |
| `disable <num>` | clear specific breakpoint |
| `clear` | clear all breakpoints |
| `[ENTER]` | repeat prev command |
```
r(eturn) Continue execution until the current function returns.
unt(il) Continue execution until the line with a number greater than the current one is reached.
unt(il) [lineno] Continue execution until a line with a number greater or equal to lineno is reached.
In both cases, also stop when the current frame returns.
d(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame).
u(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame).
Ctrl-D to exit
```