DEV Community

David Haley
David Haley

Posted on

How to debug Cython C?? πŸ€”

I'm writing a Cython optimization of a Python algorithm. It's wrong πŸ˜‘ and I'm trying to debug it.

I have a python debugger in the IDE obvs, but how do I debug the C?

I was optimistic about the docs: https://cython.readthedocs.io/en/latest/src/userguide/debugging.html

… but the instructions seem to be Linux-only, and I can't find comparable packages for Mac: python-dbg python-numpy-dbg

Meanwhile I am reduced to this:

Image description

Top comments (2)

Collapse
 
pgradot profile image
Pierre Gradot β€’

What I would do: download VirtualBox, download Ubuntu's latest ISO, setup eveything, try to reproduce on Linux, leverage the tools you have found :)

Collapse
 
dchaley profile image
David Haley β€’

Ah! Yeah, that would work. It also sounds like a lot of work πŸ˜…

Well, if I can't figure it out with print statements soon, I have this path. Thanks 😁

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay