0

For debugging Python code I use PDB++. It is a nice drop-in replacement for PDB and allows me (in sticky mode) to step through code and interact with it in a text terminal in a visual way.

However, when a Python program is already running, it is not possible to attach to the process and start debugging. That is why I am using GDB here. GDB has been configured and compiled with the --with-python option. Python has been compiled with debug symbols. When I attach to a process, commands like py-list and py-bt work fine. However, I cannot get the Python source code displayed in the TUI, like I can with e.g. C++ program and step in visual mode through code.

I tried creating a new layout, like described in the GDB documentation - TUI commands where I replaced (in a naive way) the tag src for py-list or py-src, but obviously that doesn't work.

Is there a way to have the Python source code in TUI mode and step line by line through the Python script instead of the underlying CPython implementation?

0 Answers0