kicad-developers team mailing list archive
Mailing list archive
Re: Help needed to configure gdb
Thanks Mikołaj! It works!
For anyone who might come across this thread, following gdb usage works.
>>> Build and install the debug build of kicad
>>> From windows command prompt execute:
$: I:\msys64\mingw64\bin\gdb.exe kicad
>>> Then, from the gdb shell add the breakpoint in the required line.
Answer 'y' to Make breakpoint pending on future ....
No source file named
Make breakpoint pending on future shared library load? (y or [n]) y
>>> Run the program using the following command
Now your breakpoint is active and will get triggered accordingly.
On Thu, Jul 8, 2021 at 4:47 AM Mikołaj Wielgus <wielgusmikolaj@xxxxxxxxx>
> KiCad loads symbols dynamically on runtime. So Gdb may not see them until
> KiCad starts running.
> Setting breakpoints works for me if I reply "y" to the "Make breakpoint
> pending on future shared library load? (y or [n])" prompt when the source
> file is not found. Gdb should also be able to find the source file if you
> set the breakpoint after running then interrupting KiCad.
> On Wed, Jul 7, 2021 at 3:49 PM pradeepa.kck <pradeepa.kck@xxxxxxxxx>
>> Thanks Jon. I tried that and in that case gdb launched kicad, but it
>> couldn't find the source file to set a breakpoint.
>> If someone can give me an example of setting the breakpoint that would be
>> great. I tried relative path and full path, but still couldn't set the
>> breakpoint in copper_zone_dialog.cpp.
>> - Pradeepa
>> Sent on the go with Vodafone
>> -------- Original message --------
>> From: Jon Evans <jon@xxxxxxxxxxxxx>
>> Date: 7/7/21 11:28 pm (GMT+10:00)
>> To: Pradeepa Senanayake <pradeepa.kck@xxxxxxxxx>
>> Cc: KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
>> Subject: Re: [Kicad-developers] Help needed to configure gdb
>> gdb ./kicad/kicad is starting KiCad from the build directory.
>> This isn't a fully-supported way of debugging KiCad, but if you want to
>> do this, you must set the environment variable
>> Alternatively, since you are running `make install` above, you can use
>> gdb to debug KiCad at the installed location, rather than inside the build
>> This will probably be a more reliable mechanism.
>> On Wed, Jul 7, 2021 at 9:24 AM Pradeepa Senanayake <
>> pradeepa.kck@xxxxxxxxx> wrote:
>>> 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
>>> cmake -DCMAKE_BUILD_TYPE=Debug
>>> -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.
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help : https://help.launchpad.net/ListHelp
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp