How can I configure MinGW/gdb/python so that I can debug python's C code?

0

I have downloaded python 3.6.8 with the debugger symbols and executable.

I would like to run it with gdb, as I would like to debug a dll I am loading through ctypes.

I installed Mingw-64, and have gdb.

When I run "gdb python" and then run, it uses python 2.7.9 that came with MinGW.

If I try "gdb ", I get the following:

Starting program: C:\Users\dbak\Python36\python.exe
[New Thread 23692.0x6d2c]
[New Thread 23692.0x1fbc]
[New Thread 23692.0x6970]
[New Thread 23692.0x62f4]
[New Thread 23692.0x3d80]
[Thread 23692.0x3d80 exited with code 0]
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00006d2c (most recent call first):
warning: Fatal Python error:
warning: Py_Initialize: unable to load the file system codec
warning:
gdb: unknown target exception 0xc0000409 at 0x7ff90d5fe91e

Thread 1 received signal ?, Unknown signal.
0x00007ff90d5fe91e in ucrtbase!abort () from C:\Windows\System32\ucrtbase.dll

I am not really sure what I can do in order to debug the version of python 3.6 I have installed.

python
gdb
mingw-w64

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0