← Back to team overview

kicad-developers team mailing list archive

Help needed to configure gdb


Hello All,

Sorry for the long mail.

I'm trying to debug one of my changes using gdb and I've run into a

This is what I did so far,

>> Built KiCAD using following commands

      -G "MSYS Makefiles"
make -j 4 install

>> Started gdb using the following command

$: gdb ./kicad/kicad

Reading symbols from ./kicad/kicad.exe...
(gdb) run
Starting program:
[New Thread 16296.0x41b0]
[New Thread 16296.0x3e0c]
[New Thread 16296.0x2130]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable =
  sys.base_prefix = 'D:/a/_temp/msys/msys64/mingw64'
  sys.base_exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
  sys.executable =
  sys.prefix = 'D:/a/_temp/msys/msys64/mingw64'
  sys.exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
  sys.path = [
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00003154 (most recent call first):
<no Python frame>
warning: Fatal Python error:
warning: failed to get the Python codec of the filesystem encoding
[Thread 16296.0x3e0c exited with code 1]
[Thread 16296.0x2130 exited with code 1]
[Thread 16296.0x41b0 exited with code 1]
[Inferior 1 (process 16296) exited with code 01]

I've set the PYTHONHOME to /mingw64

Now I can launch KiCad in gdb. However, it now gives many errors,

Ex: can't open file

I feel that it's something to do with paths, however, it's hard to figure
out without knowing how everything fits together.

Can someone please give me a hand?

Best Regards,
Pradeepa Senanayake.

Follow ups