From Python 3.14, python -m pdb -p pid lets you connect a pdb session to a running Python process. | rtpg.co