[Numpy-discussion] Help Regarding Debugging Cython Code

Matti Picus matti.picus at gmail.com
Sun Sep 5 08:57:09 EDT 2021


On 5/9/21 12:55 pm, Amardeep Singh wrote:
> Hi Team
>
> If some one has setup to debug cython code can  you please share 
> the details.
> I am using ubuntu 20.4 .
> Not sure why gdb not picking up breakpoints.
>
> I am able to debug c extensions but not cython code.
>
> Thx


There are a number of ways to set up for debugging. The one that works 
for me is to do


git clean -xfdd

CFLAGS='-O0 -g3' python runtests.py -b

gdb --args python runtests.py -t file/I/with/the/test/I/want.py


The "git clean" should make sure you are not using pre-compiled 
c-extensions.

There are variants of this if you are using an IDE or like to use 
setup.py directly


Matti



More information about the NumPy-Discussion mailing list