Debugging Python C extensions with GDB

2 · Red Hat · Sept. 8, 2021, 4:03 a.m.
Many popular Python modules are written in the C language, and bugs in C extensions can cause nasty crashes that Python's error-catching mechanism won't catch. Fortunately, numerous powerful debuggers—notably, the GNU Project Debugger (GDB)—were designed for the C language. In Python 3.9, developers can use these to debug Python programs, and particularly the C extensions included in Python programs. This article shows how to use the improved Python debug build in Python 3.9. I'll first discuss ...