Debug C-library from Python (ctypes)

前端 未结 2 940
生来不讨喜
生来不讨喜 2021-02-19 21:00

I have a Python-program that uses ctypes and a C-shared library (dll-file). As an IDE, I am using Eclipse, where both projects will be developed (the C-shared library and the py

2条回答
  •  感动是毒
    2021-02-19 21:06

    As far as I know, not in eclipse.

    However, Python tools for visual studio has this capability:

    https://pytools.codeplex.com/wikipage?title=Mixed-mode%20debugging

    It is also possible to get this for free. From the Microsoft website, you'll need (as well as a copy of Windows)

    1) Visual Studio (paid Pro+ version or free Express versions (starting w 2.1Beta))

    2) PTVS extension (this gives VS Python support)

    3) A Python interpreter and Python Libraries (these are not bundled with PTVS)

    This means that you can debug python and c side-by-side. Calls to libraries written in c are captured by the debugger, provided that they were compiled with symbols by visual studio.

    Note that the capabilities of mixed mode debugging tend to be less featured for native python, but it is still capable of using the regular native debugger.

提交回复
热议问题