Unable to track down a duchain bug

Hamish Rodda rodda at kde.org
Mon Dec 10 05:14:22 UTC 2007


Hi,

Quite a while ago David added an assert in the c++ duchain context builder 
that the top level context should not have a parent smart range.

This is quite easily triggerable - just open a project, open any cpp file in 
it (I use kdevplatform and plugins/classmodel.cpp), wait for it to parse, 
then open the corresponding header, and start editing - crash.

I have so far been unable to track down where this occurs.  I attach my 
patches which add debug asserts and smart range watchers to try to find out 
the root cause - so far, all i can see is that top level contexts go into the 
chain ok (probably not as smart ranges), then come out with a spurious parent 
in their smart range.

I guess this may be due to some smart range conversion code (I still think 
it's a mistake to have it in more than one location), but i haven't found it 
yet.  (Note to self: maybe I should review this code.)

If anyone is interested in working on this problem, I attach my debug patches 
+ class (copy to platform/editor, platform/languages/duchain, and 
kdevelop/language/cpp)

Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debugwatcher.h
Type: text/x-c++hdr
Size: 1360 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20071210/fb87b321/attachment.hh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdev-track-down-spurious-parent2.patch
Type: text/x-diff
Size: 634 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20071210/fb87b321/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdev-track-down-spurious-parent.patch
Type: text/x-diff
Size: 2562 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20071210/fb87b321/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20071210/fb87b321/attachment.sig>


More information about the KDevelop-devel mailing list