Python Debugging Requirements

Python Version

To debug C/C++ Python extensions, install the debugging information for your version of the Python interpreter. This provides the necessary insight into the Python data structures for the debugger to extract Python stack and variable information.

Packaged versions of the debugging symbol interpreter can be installed with:

CentOS/RedHat Enterprise/Fedora Linux:
sudo yum install python-devel
sudo debuginfo-install glibc
sudo debuginfo-install python
Ubuntu:
sudo apt-get install python-dev
sudo apt-get install python-dbg

Limitations and Extensions

The following functionality and limitations exist:

Python version: Python 2.7, and Python 3.5 and above.

Python compiled with debug information:

Debug information is required. If you are building your own Python version, the easiest way is to use the  ‑‑ with‑pydebug flag:

configure --with-pydebug

This option incorporates the -g option (debug information) and the -O0 option (no optimization). Optimizations can prevent TotalView from obtaining Python function, line, number, variable, or frame information, in which case it displays "Optimized out.” See Building and Using a Debug Version of Python for details on building a debug version of the interpreter.

For a pre-built Python distribution, check the documentation, installation guide and any configure files for information on how it was compiled.

Python type support: Current support for Python types includes scalar types int, float, long, complex, str, and Numpy ndarray. Future support will include other sequence, mapping, and set types.

Python extension technologies: Current support for the many Python extension technologies includes:

SWIG to perform stack frame transformations

ctypes to call functions in DLLs or shared libraries

pybind11 for operability between C++11 and Python

Support for other Python extensions will be added to the product.

Python distributions: Python debugging support has been tested on Python distributed with various operating systems. Support of the Enthought Python 3.5 distribution has also been validated. The Anaconda Python distribution is not supported due to the unavailability of debug information with the distribution.

If you have feedback or feature requests on Python debugging in TotalView, please let us know at https://totalview.io/support.