Re: [Kicad-developers] Help needed to configure gdb

2021-07-08 Thread Pradeepa Senanayake
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 

(gdb) break
I:/msys64/home/Pradeepa/kicad-source/pcbnew/dialogs/dialog_copper_zones.cpp:155
No source file named
I:/msys64/home/Pradeepa/kicad-source/pcbnew/dialogs/dialog_copper_zones.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2
(I:/msys64/home/Pradeepa/kicad-source/pcbnew/dialogs/dialog_copper_zones.cpp:155)
pending.

>>> Run the program using the following command

(gdb) run

Now your breakpoint is active and will get triggered accordingly.

Cheers!
Best Regards,
Pradeepa Senanayake.


On Thu, Jul 8, 2021 at 4:47 AM Mikołaj Wielgus 
wrote:

> 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.
>
> Best,
> Mikołaj
>
>
> On Wed, Jul 7, 2021 at 3:49 PM pradeepa.kck 
> wrote:
>
>> 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 
>> Date: 7/7/21 11:28 pm (GMT+10:00)
>> To: Pradeepa Senanayake 
>> Cc: KiCad Developers 
>> 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
>>
>> KICAD_RUN_FROM_BUILD_DIR=1
>>
>> Alternatively, since you are running `make install` above, you can use
>> gdb to debug KiCad at the installed location, rather than inside the build
>> directory.
>>
>> This will probably be a more reliable mechanism.
>>
>> -Jon
>>
>> On Wed, Jul 7, 2021 at 9:24 AM Pradeepa Senanayake <
>> pradeepa@gmail.com> 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
>>> roadblock.
>>>
>>> This is what I did so far,
>>>
>>> >> Built KiCAD using following commands
>>>
>>> cmake -DCMAKE_BUILD_TYPE=Debug
>>>   -G "MSYS Makefiles"
>>>   -DCMAKE_PREFIX_PATH=/mingw64
>>>-DCMAKE_INSTALL_PREFIX=/mingw64
>>>-DDEFAULT_INSTALL_PATH=/mingw64
>>>-DOCC_INCLUDE_DIR=/mingw64/include/opencascade
>>>-DPYTHON_INCLUDE_DIR=/mingw64/include/python3.8
>>>../../
>>> make -j 4 install
>>>
>>> >> Started gdb using the following command
>>>
>>> $: gdb ./kicad/kicad
>>>
>>> ...
>>> ...
>>> Reading symbols from ./kicad/kicad.exe...
>>> (gdb) run
>>> Starting program:
>>> I:\msys64\home\Pradeepa\kicad-source\build\debug\kicad\kicad.exe
>>> [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 =
>>> 'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'
>>>   sys.base_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>>   sys.base_exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>>   sys.executable =
>>> 'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'
>>>   sys.prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>>   sys.exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>>   sys.path = [
>>> 'D:/a/_temp/msys/msys64/mingw64/l

Re: [Kicad-developers] Help needed to configure gdb

2021-07-07 Thread Mikołaj Wielgus
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.

Best,
Mikołaj


On Wed, Jul 7, 2021 at 3:49 PM pradeepa.kck  wrote:

> 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 
> Date: 7/7/21 11:28 pm (GMT+10:00)
> To: Pradeepa Senanayake 
> Cc: KiCad Developers 
> 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
>
> KICAD_RUN_FROM_BUILD_DIR=1
>
> Alternatively, since you are running `make install` above, you can use gdb
> to debug KiCad at the installed location, rather than inside the build
> directory.
>
> This will probably be a more reliable mechanism.
>
> -Jon
>
> On Wed, Jul 7, 2021 at 9:24 AM Pradeepa Senanayake 
> 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
>> roadblock.
>>
>> This is what I did so far,
>>
>> >> Built KiCAD using following commands
>>
>> cmake -DCMAKE_BUILD_TYPE=Debug
>>   -G "MSYS Makefiles"
>>   -DCMAKE_PREFIX_PATH=/mingw64
>>-DCMAKE_INSTALL_PREFIX=/mingw64
>>-DDEFAULT_INSTALL_PATH=/mingw64
>>-DOCC_INCLUDE_DIR=/mingw64/include/opencascade
>>-DPYTHON_INCLUDE_DIR=/mingw64/include/python3.8
>>../../
>> make -j 4 install
>>
>> >> Started gdb using the following command
>>
>> $: gdb ./kicad/kicad
>>
>> ...
>> ...
>> Reading symbols from ./kicad/kicad.exe...
>> (gdb) run
>> Starting program:
>> I:\msys64\home\Pradeepa\kicad-source\build\debug\kicad\kicad.exe
>> [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 =
>> 'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'
>>   sys.base_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>   sys.base_exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>   sys.executable =
>> 'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'
>>   sys.prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>   sys.exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>>   sys.path = [
>> 'D:/a/_temp/msys/msys64/mingw64/lib/python38.zip',
>> 'D:/a/_temp/msys/msys64/mingw64/lib/python3.8',
>> 'D:/a/_temp/msys/msys64/mingw64/lib/python3.8',
>> 'D:/a/_temp/msys/msys64/mingw64/lib/lib-dynload',
>>   ]
>> Could not find platform independent libraries 
>> Could not find platform dependent libraries 
>> Consider setting $PYTHONHOME to [:]
>> 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 0x3154 (most recent call first):
>> 
>> warning: Fatal Python error:
>> warning: failed to get the Python codec of the filesystem encoding
>> warning:
>> [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]
>> (gdb)
>>
>> 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:\msys64\home\Pradeepa\kicad-source\build\debug\share\kicad\resources\images.tar.gz
>>
>> I feel that it's something to do with paths, however, it's hard to figure
>> out without knowing how everyt

Re: [Kicad-developers] Help needed to configure gdb

2021-07-07 Thread pradeepa.kck
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  Date: 
7/7/21  11:28 pm  (GMT+10:00) To: Pradeepa Senanayake  
Cc: KiCad Developers  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 
variableKICAD_RUN_FROM_BUILD_DIR=1Alternatively, since you are running `make 
install` above, you can use gdb to debug KiCad at the installed location, 
rather than inside the build directory.This will probably be a more reliable 
mechanism.-JonOn Wed, Jul 7, 2021 at 9:24 AM Pradeepa Senanayake 
 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 roadblock.This is what I 
did so far,>> Built KiCAD using following commandscmake 
-DCMAKE_BUILD_TYPE=Debug      -G "MSYS Makefiles"      
-DCMAKE_PREFIX_PATH=/mingw64       -DCMAKE_INSTALL_PREFIX=/mingw64       
-DDEFAULT_INSTALL_PATH=/mingw64       
-DOCC_INCLUDE_DIR=/mingw64/include/opencascade       
-DPYTHON_INCLUDE_DIR=/mingw64/include/python3.8       ../../make -j 4 install>> 
Started gdb using the following command$: gdb ./kicad/kicad..Reading 
symbols from ./kicad/kicad.exe...(gdb) runStarting program: 
I:\msys64\home\Pradeepa\kicad-source\build\debug\kicad\kicad.exe[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 = 
'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'  
sys.base_prefix = 'D:/a/_temp/msys/msys64/mingw64'  sys.base_exec_prefix = 
'D:/a/_temp/msys/msys64/mingw64'  sys.executable = 
'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'  sys.prefix 
= 'D:/a/_temp/msys/msys64/mingw64'  sys.exec_prefix = 
'D:/a/_temp/msys/msys64/mingw64'  sys.path = [    
'D:/a/_temp/msys/msys64/mingw64/lib/python38.zip',    
'D:/a/_temp/msys/msys64/mingw64/lib/python3.8',    
'D:/a/_temp/msys/msys64/mingw64/lib/python3.8',    
'D:/a/_temp/msys/msys64/mingw64/lib/lib-dynload',  ]Could not find platform 
independent libraries Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]Fatal 
Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encodingPython runtime state: core initializedModuleNotFoundError: 
No module named 'encodings'Current thread 0x3154 (most recent call 
first):warning: Fatal Python error:warning: failed to get the 
Python codec of the filesystem encodingwarning:[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](gdb)I've set the 
PYTHONHOME to /mingw64Now I can launch KiCad in gdb. However, it now gives many 
errors,Ex: can't open file 
I:\msys64\home\Pradeepa\kicad-source\build\debug\share\kicad\resources\images.tar.gzI
 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?Thanks!Best Regards,Pradeepa Senanayake.
___
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed to configure gdb

2021-07-07 Thread Jon Evans
 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

KICAD_RUN_FROM_BUILD_DIR=1

Alternatively, since you are running `make install` above, you can use gdb
to debug KiCad at the installed location, rather than inside the build
directory.

This will probably be a more reliable mechanism.

-Jon

On Wed, Jul 7, 2021 at 9:24 AM Pradeepa Senanayake 
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
> roadblock.
>
> This is what I did so far,
>
> >> Built KiCAD using following commands
>
> cmake -DCMAKE_BUILD_TYPE=Debug
>   -G "MSYS Makefiles"
>   -DCMAKE_PREFIX_PATH=/mingw64
>-DCMAKE_INSTALL_PREFIX=/mingw64
>-DDEFAULT_INSTALL_PATH=/mingw64
>-DOCC_INCLUDE_DIR=/mingw64/include/opencascade
>-DPYTHON_INCLUDE_DIR=/mingw64/include/python3.8
>../../
> make -j 4 install
>
> >> Started gdb using the following command
>
> $: gdb ./kicad/kicad
>
> ...
> ...
> Reading symbols from ./kicad/kicad.exe...
> (gdb) run
> Starting program:
> I:\msys64\home\Pradeepa\kicad-source\build\debug\kicad\kicad.exe
> [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 =
> 'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'
>   sys.base_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>   sys.base_exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>   sys.executable =
> 'I:/msys64/home/Pradeepa/kicad-source/build/debug/kicad/kicad.exe'
>   sys.prefix = 'D:/a/_temp/msys/msys64/mingw64'
>   sys.exec_prefix = 'D:/a/_temp/msys/msys64/mingw64'
>   sys.path = [
> 'D:/a/_temp/msys/msys64/mingw64/lib/python38.zip',
> 'D:/a/_temp/msys/msys64/mingw64/lib/python3.8',
> 'D:/a/_temp/msys/msys64/mingw64/lib/python3.8',
> 'D:/a/_temp/msys/msys64/mingw64/lib/lib-dynload',
>   ]
> Could not find platform independent libraries 
> Could not find platform dependent libraries 
> Consider setting $PYTHONHOME to [:]
> 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 0x3154 (most recent call first):
> 
> warning: Fatal Python error:
> warning: failed to get the Python codec of the filesystem encoding
> warning:
> [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]
> (gdb)
>
> 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:\msys64\home\Pradeepa\kicad-source\build\debug\share\kicad\resources\images.tar.gz
>
> 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?
>
> Thanks!
> Best Regards,
> Pradeepa Senanayake.
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed

2020-09-25 Thread Franck Jullien
Thank you Seth, it works now.

@Jean-Pierre : I'll do what you suggested and iterate over screens
instead of sheets.

Franck.

Le ven. 25 sept. 2020 à 19:10, Seth Hillbrand  a écrit :
>
> Hi Franck-
>
> You cannot delete items from the rtree while iterating over it, the 
> references are invalidated.  You will need to collect the items to delete in 
> a separate vector and delete them outside of the loop.
>
> Seth
>
> On Fri, Sep 25, 2020, 7:29 AM Franck Jullien  wrote:
>>
>> Hi,
>>
>> I'm working on the intersheets references functionality and I'm
>> struggling with a segfault.
>> Until now, I didn't try to remove iref from sheets. Now, I do this with:
>>
>> void SCH_EDIT_FRAME::RemoveAllIntersheetsRefs()
>> {
>> SCH_SHEET_LIST sheets = Schematic().GetSheets();
>> SCH_GLOBALLABEL* gLabel;
>>
>> m_labelTable.clear();
>>
>> for( const SCH_SHEET_PATH& sheet : sheets )
>> {
>> SCH_SCREEN* screen = sheet.LastScreen();
>>
>> for( SCH_ITEM* item : screen->Items() )
>> {
>>
>> if( item->Type() == SCH_GLOBAL_LABEL_T )
>> {
>> gLabel = (SCH_GLOBALLABEL*)( item );
>> SCH_IREF* iref = gLabel->GetIref();
>>
>> if( iref )
>> {
>> gLabel->SetIref( nullptr );
>> gLabel->SetIrefSavedPosition( wxDefaultPosition );
>> screen->DeleteItem( iref );
>> }
>> }
>> }
>> }
>> }
>>
>> As soon as I call DeleteItem (or RemoveFromScreen) I get a crash.
>> Is there something obvious I don't see ?
>>
>> I still need to get familiar with screens, sheets, frames, canvas, views
>>
>> Thanks in advance.
>>
>> Franck.
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed

2020-09-25 Thread jp charras


Le 25/09/2020 à 16:32, Jon Evans a écrit :
Can you run with ASAN on (KICAD_SANITIZE in CMake) and see if you get 
some info about why you get a segfault?


On Fri, Sep 25, 2020 at 10:28 AM Franck Jullien 
mailto:franck.jull...@gmail.com>> wrote:


Hi,

I'm working on the intersheets references functionality and I'm
struggling with a segfault.
Until now, I didn't try to remove iref from sheets. Now, I do this
with:

void SCH_EDIT_FRAME::RemoveAllIntersheetsRefs()
{
    SCH_SHEET_LIST sheets = Schematic().GetSheets();
    SCH_GLOBALLABEL* gLabel;

    m_labelTable.clear();

    for( const SCH_SHEET_PATH& sheet : sheets )
    {
        SCH_SCREEN* screen = sheet.LastScreen();

        for( SCH_ITEM* item : screen->Items() )
        {

            if( item->Type() == SCH_GLOBAL_LABEL_T )
            {
                gLabel = (SCH_GLOBALLABEL*)( item );
                SCH_IREF* iref = gLabel->GetIref();

                if( iref )
                {
                    gLabel->SetIref( nullptr );
                    gLabel->SetIrefSavedPosition( wxDefaultPosition );
                    screen->DeleteItem( iref );
                }
            }
        }
    }
}

As soon as I call DeleteItem (or RemoveFromScreen) I get a crash.
Is there something obvious I don't see ?

I still need to get familiar with screens, sheets, frames, canvas,
views

Thanks in advance.

Franck.



I am guessing screen->DeleteItem( iref ); remove an item from 
screen->Items()


Usually, when removing an item from a list, the pointers used to explore 
the list become invalid.


But screen->Items() is a rtree, and I am not experienced with rtrees.

I am unsure exploring all sheets is working well in complex hierarchies 
(complex hierarchies are hierarchies with a sheet instantiated more than 
once.


Probably exploring the screen list is enough.


--
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed

2020-09-25 Thread Franck Jullien
Thanks for the tip, I didn't know we could run ASAN with Kicad easily.
This is what I get:

==7559==ERROR: AddressSanitizer: heap-use-after-free on address
0x612403c4 at pc 0x7f1ec5130bb9 bp 0x7ffe8351d540 sp
0x7ffe8351d530
READ of size 4 at 0x612403c4 thread T0
#0 0x7f1ec5130bb8 in RTree::Node::IsLeaf() ../kicad/thirdparty/rtree/geometry/rtree.h:481
#1 0x7f1ec51311d9 in RTree::Iterator::FindNextData()
../kicad/thirdparty/rtree/geometry/rtree.h:353
#2 0x7f1ec512f08d in RTree::Iterator::operator++()
../kicad/thirdparty/rtree/geometry/rtree.h:316
#3 0x7f1ec5938152 in SCH_EDIT_FRAME::RemoveAllIntersheetsRefs()
../kicad/eeschema/sch_edit_frame.cpp:1284
#4 0x7f1ec5938599 in SCH_EDIT_FRAME::CommonSettingsChanged(bool,
bool) ../kicad/eeschema/sch_edit_frame.cpp:1315
.

I'll take a look.

Le ven. 25 sept. 2020 à 16:32, Jon Evans  a écrit :
>
> Can you run with ASAN on (KICAD_SANITIZE in CMake) and see if you get some 
> info about why you get a segfault?
>
> On Fri, Sep 25, 2020 at 10:28 AM Franck Jullien  
> wrote:
>>
>> Hi,
>>
>> I'm working on the intersheets references functionality and I'm
>> struggling with a segfault.
>> Until now, I didn't try to remove iref from sheets. Now, I do this with:
>>
>> void SCH_EDIT_FRAME::RemoveAllIntersheetsRefs()
>> {
>> SCH_SHEET_LIST sheets = Schematic().GetSheets();
>> SCH_GLOBALLABEL* gLabel;
>>
>> m_labelTable.clear();
>>
>> for( const SCH_SHEET_PATH& sheet : sheets )
>> {
>> SCH_SCREEN* screen = sheet.LastScreen();
>>
>> for( SCH_ITEM* item : screen->Items() )
>> {
>>
>> if( item->Type() == SCH_GLOBAL_LABEL_T )
>> {
>> gLabel = (SCH_GLOBALLABEL*)( item );
>> SCH_IREF* iref = gLabel->GetIref();
>>
>> if( iref )
>> {
>> gLabel->SetIref( nullptr );
>> gLabel->SetIrefSavedPosition( wxDefaultPosition );
>> screen->DeleteItem( iref );
>> }
>> }
>> }
>> }
>> }
>>
>> As soon as I call DeleteItem (or RemoveFromScreen) I get a crash.
>> Is there something obvious I don't see ?
>>
>> I still need to get familiar with screens, sheets, frames, canvas, views
>>
>> Thanks in advance.
>>
>> Franck.
>>
>> ___
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed

2020-09-25 Thread Jon Evans
Can you run with ASAN on (KICAD_SANITIZE in CMake) and see if you get some
info about why you get a segfault?

On Fri, Sep 25, 2020 at 10:28 AM Franck Jullien 
wrote:

> Hi,
>
> I'm working on the intersheets references functionality and I'm
> struggling with a segfault.
> Until now, I didn't try to remove iref from sheets. Now, I do this with:
>
> void SCH_EDIT_FRAME::RemoveAllIntersheetsRefs()
> {
> SCH_SHEET_LIST sheets = Schematic().GetSheets();
> SCH_GLOBALLABEL* gLabel;
>
> m_labelTable.clear();
>
> for( const SCH_SHEET_PATH& sheet : sheets )
> {
> SCH_SCREEN* screen = sheet.LastScreen();
>
> for( SCH_ITEM* item : screen->Items() )
> {
>
> if( item->Type() == SCH_GLOBAL_LABEL_T )
> {
> gLabel = (SCH_GLOBALLABEL*)( item );
> SCH_IREF* iref = gLabel->GetIref();
>
> if( iref )
> {
> gLabel->SetIref( nullptr );
> gLabel->SetIrefSavedPosition( wxDefaultPosition );
> screen->DeleteItem( iref );
> }
> }
> }
> }
> }
>
> As soon as I call DeleteItem (or RemoveFromScreen) I get a crash.
> Is there something obvious I don't see ?
>
> I still need to get familiar with screens, sheets, frames, canvas,
> views
>
> Thanks in advance.
>
> Franck.
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed to fix a minor issue in GAL mode

2015-05-12 Thread jp charras
Le 12/05/2015 12:06, Maciej Sumiński a écrit :
 Hi Jean-Pierre,
 
 Thank you for noting, it should be fixed in revision 5652.
 
 Regards, Orson


Thanks. Works fine now.


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Help needed to fix a minor issue in GAL mode

2015-05-12 Thread Maciej Sumiński
Hi Jean-Pierre,

Thank you for noting, it should be fixed in revision 5652.

Regards,
Orson

On 05/12/2015 11:24 AM, jp charras wrote:
 Hi, Orson.
 
 I need your help to fix a minor but very strange issue in Pcbnew, in GAL
 mode, relative to hot keys.
 
 This is about grid selection from hotkeys (next and previous grid
 selection with 'N' and 'shift N' keys, and also fast grid selection).
 
 In legacy mode, all is OK, but in GAL mode the actual grid on screen is
 not updated.
 
 When PCB_BASE_FRAME::SetNextGrid() and PCB_BASE_FRAME::SetPrevGrid() are
 called from the OnHotKey(), the grid combo box is updated as expected,
 but the grid shown on screen does not change (is not updated).
 
 I made some tests, and if these same functions are called from for
 instance a dialog, the grid shown on screen is updated.
 
 This is only when these functions are called from a hotkey the issue
 appears.
 
 In other words, for me the call:
 
 GetToolManager()-RunAction( common.Control.gridPreset, true, value);
 
 works fine when called from a dlg (or combo box) event, but not from
 OnHotKey() (called from a wxKeyEvent event ).
 
 
 Currently, I am unable to fix this minor issue.
 
 Thanks for your help.
 




signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [help needed] wx transparent always-on-top window

2014-12-01 Thread Wayne Stambaugh
Hey Tom,

The closest thing I've seen to what you are looking for are the advanced
tooltip classes in the wxPython demo.  Although none of them is what you
are looking for.  What about using the message panel to show the matched
pair information while drawing?  It may not be as slick as what you are
proposing but if you don't have the time and you can find an of the
shelf solution, it may be good enough.

Cheers,

Wayne

On 11/30/2014 11:41 AM, Tomasz Wlostowski wrote:
 Dear Kicad Devs,
 
 I'm looking for a wx widget class implementing a transparent
 always-on-top window that follows mouse cursor (like in the attached
 drawing). The window will be used for displaying the current track
 length/impedance/phase skew when routing/tuning (or any other information).
 
 If someone of you could volunteer to implement such a class or point me
 to something that works out-of-the box, I'd be very grateful.
 
 Cheers,
 Tom
 
 
 
 ___
 Mailing list: https://launchpad.net/~kicad-developers
 Post to : kicad-developers@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~kicad-developers
 More help   : https://help.launchpad.net/ListHelp
 


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [help needed] wx transparent always-on-top window

2014-12-01 Thread Tomasz Wlostowski
On 01.12.2014 16:41, Wayne Stambaugh wrote:
 Hey Tom,
 
 The closest thing I've seen to what you are looking for are the advanced
 tooltip classes in the wxPython demo.  Although none of them is what you
 are looking for.  What about using the message panel to show the matched
 pair information while drawing?  It may not be as slick as what you are
 proposing but if you don't have the time and you can find an of the
 shelf solution, it may be good enough.
 
Hi Wayne,

Thanks for the tip with the message panel, it's good enough for
displaying such info. We can add the fly-over status later on.

Cheers,
Tom

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp