I have source code for an extension in Python. I want to see debug symbols for that extension when I debug it. How do I tell PIP to compile and link debug symbols for my extension?
(Preferably platform agnostic, else Linux)
I have source code for an extension in Python. I want to see debug symbols for that extension when I debug it. How do I tell PIP to compile and link debug symbols for my extension?
(Preferably platform agnostic, else Linux)
You need to invoke setup.py
's build
command with --debug
flag during package installation. Using pip
additional flags to setup.py
can be passed using --global-option
:
pip install --no-binary :all: --global-option build --global-option --debug PACKAGE
In case of errors try upgrading pip
and setuptools
:
pip install -U setuptools
pip install -U pip
I found this information in this blogpost by Jonathan Lange: https://jml.io/2015/08/debugging-python-with-gdb.html
© 2022 - 2024 — McMap. All rights reserved.