On 14 Nov 2022, at 19:10, Jen Kris via Python-list <python-list@python.org> wrote:
In September 2021, Victor Stinner wrote “Debugging Python C extensions with GDB” (https://developers.redhat.com/articles/2021/09/08/debugging-python-c-extensions-gdb#getting_started_with_python_3_9).
My question is: with Python 3.9+, can I debug into a C extension written in pure C and called from ctypes -- that is not written using the C_API?
Thanks.
Jen
--
https://mail.python.org/mailman/listinfo/python-list
On 14 Nov 2022, at 19:10, Jen Kris via Python-list <python-list@python.org> wrote:
In September 2021, Victor Stinner wrote “Debugging Python C extensions with GDB” (https://developers.redhat.com/articles/2021/09/08/debugging-python-c-extensions-gdb#getting_started_with_python_3_9).
My question is: with Python 3.9+, can I debug into a C extension written in pure C and called from ctypes -- that is not written using the C_API?
Yes.
Just put a breakpoint on the function in the c library that you want to debug.
You can set the breakpoint before a .so is loaded.
Barry
Thanks.
Jen
--
https://mail.python.org/mailman/listinfo/python-list
On 14 Nov 2022, at 23:44, Jen Kris <jenkris@tutanota.com> wrote:
Thanks for your reply. Victor's article didn't mention ctypes extensions, so I wanted to post a question before I build from source.
Nov 14, 2022, 14:32 by barry@barrys-emacs.org:
On 14 Nov 2022, at 19:10, Jen Kris via Python-list <python-list@python.org> wrote:
In September 2021, Victor Stinner wrote “Debugging Python C extensions with GDB” (https://developers.redhat.com/articles/2021/09/08/debugging-python-c-extensions-gdb#getting_started_with_python_3_9).
My question is: with Python 3.9+, can I debug into a C extension written in pure C and called from ctypes -- that is not written using the C_API?
Yes.
Just put a breakpoint on the function in the c library that you want to debug.
You can set the breakpoint before a .so is loaded.
Barry
Thanks.
Jen
--
https://mail.python.org/mailman/listinfo/python-list
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 65:16:59 |
Calls: | 6,712 |
Files: | 12,244 |
Messages: | 5,356,205 |