10 Comments
Jul 6, 2023Liked by Bite Code!

Great article. pdb is one of those tools which has a pretty large ROI payoff and everyone should learn to use. One point I feel should be mentioned (and the main reason I switched to using the PyCharm debugger) is that pdb doesn't support debugging multithreaded programs very well (See https://github.com/python/cpython/issues/85743, https://github.com/python/cpython/issues/67352 and https://github.com/python/cpython/issues/65480)

Expand full comment

Loving this post. I use pdb because I’m debugging code that executes within a docker container and docker compose. I use breakpoint(), step, continue, next, and list quite a bit. Jump, until, and display are new to me though. Does display stop and show a value whenever a value changes, even if you’re next-ing over a function call?

Expand full comment

If you like pdb making the jump to PyCharm will payoff huge.

Some advantages:

The breakpoints aren't part of the code

You can group them and toggle them off and on

When a break point hits you can jump up the stack which will take you to that code and also give you access to the context at that point

Conditional breakpoints

You have a console just like pdb and can execute code.

Expand full comment

Awesome guide! I blindly use ipdb with a small subset of all these commands. I'd be curious to hear your thoughts on the benefits vs vanilla pdb.

Expand full comment