/// This is a helper function for the sort routine.
template<typename _RandomAccessIterator, typename _Compare>
void
__unguarded_linear_insert(_RandomAccessIterator __last,
_Compare __comp)
{
typename iterator_traits<_RandomAccessIterator>::value_type
__val = _GLIBCXX_MOVE(*__last);
_RandomAccessIterator __next = __last;
--__next;
while (__comp(__val, __next)) ---->ISSUE: might go ahead of the first iterator
{
*__last = _GLIBCXX_MOVE(*__next);
__last = __next;
--__next;
}
*__last = _GLIBCXX_MOVE(__val);
}
if (!lhs || !rhs)
return 1;
if (lhs->m_SpecialFolder != sfToken || rhs->m_SpecialFolder != sfToken)
return -1;
if (!lhs->m_Token || !rhs->m_Token)
return 1;
We know what the problem is.Hi, your word scary me a lot about this.
There is no single person willing to spend the time to do the correct fix.
I don't have the time nor interest in doing this any time soon.
ollydbg had a similar fix in some of the topics about this issue.
Am I wrong about?The feature is disabled when it leads to problems, so users don't hit the problem.
We know what the problem is.However, I don't agree this. If there were some known bugs with potential solution, someone should share the issue with others even though he or she was no interest in fixing it, instead leaving other users to wasting time to re-work for it.
There is no single person willing to spend the time to do the correct fix.
I don't have the time nor interest in doing this any time soon.
ollydbg had a similar fix in some of the topics about this issue.
ollydbg had a similar fix in some of the topics about this issue.This is the direction I would like to go if I have time, but it looks like this is quite complex.
The use of CCTree seems rather complexIt has exactly the same interface of wxTreeCtrl without the GUI part, the only visible difference are the use of pointers to items and the FindFirstChild() cookie type.
struct NaryTreeNode
{
void* data;
NaryTreeNode* nextSibling;
NaryTreeNode* firstChild;
};
for ( NaryTreeNode* i = n->firstChild; i!=NULL; i=i->nextSibling )
{...
I was using wxStopWatch.I try to apply the patch file "symbol_browser.patch" in my local git repo.
The code works the same as before, only the dump parts have been added, and they use the main thread because it is the only one allowed to access the CCTreeCtrl.
- The top tree creation is made in the worker thread as before.
- The worker thread only activates (now and before) when the top tree changes due to a code completion token tree change.
- The top tree dump is made by the main thread when the tree is finished (this part is new).
- The bottom tree creation and dump are made by the main thread in the OnSelect event (just like before). Of course, the dump adds delay.
The tree leaves are created dynamically when expanding their parent, and deleted when the parent is collapsed, just like in the original code. This work is (and was) made by the main thread.
I find it quite usable if you don't use the Everything option.
I have attached my final changes, just in case anybody wants to test/profile/modify or reuse parts.
$ patch -p0 ../symbol_browser.patch
- const TokenIdxSet* tokens = tree->GetTokensBelongToFile(*itf);
+ const TokenIdxSet *tokens = tree->GetTokensBelongToFile(*itf);
I have attached a patch file generated with svn diff --gitafter several busy days, I tried this patch and it works find for me.
git apply ~/Downloads/symbol_browser_git.patch -p2
Thanks for this perfect work and patch.I guess your project is either small or you could tolerate long UI pauses.
Most of the pauses are already in the original code, the greatest one is in the OnSelect() event due to full bottom tree creation in main thread.Yes, you are right. there are some short pauses when click the top tree items.
I would suggest this for the next release.Do you get UI pauses? Because this is a major no-go...
I would suggest this for the next release.+1+1+1+1+1
Do you get UI pauses? Because this is a major no-go...I can fully understand that someone not using that feature must have reservations about adding a not fully performant piece of UI. But I beg you to re-consider your position. Unless there is no safe way to protect the UI performance when the Symbol browser is diabled, I think this is a special situation. We have the choice between a very useful function (but slow yet) or no useful function at all. As a C::B user I would not like to be locked out of that decision.
I can fully understand that someone not using that feature must have reservations about adding a not fully performant piece of UI. But I beg you to re-consider your position.You'll have the right to beg after you try it with your bigger projects. :)
You'll have the right to beg after you try it with your bigger projects. :)
So I really can not confirm any performance impacts, sorry. Whatever you can measure might be something different, but a negative impact on a fluent work flow could not be seen in this test.The negative impact is when you're not using it and you're just typing and your typing is interrupted by this feature.
The negative impact is when you're not using it and you're just typing and your typing is interrupted by this feature.Now I understand why you are mainly interested in the main thread timing. Thanks for clarifying.
There is one severe problem for practical use:
The browser often closes the opened class and jumps to the first entry. It looks like its loosing its postition. It does not happen every time, possibly it has to do with windows not yet loaded. Here is how to Reproduce
1. open CodeBlocks workspace and switch to Symbols tab. No windows should be open in the editor
2 scroll to ClassBrowser and open
3. double click on first memeber var "m_activeFilename: wxString"
=> The header file will open. The class browser closes the class and jumps to the top entry. This closing was on my system delayed by about 1-2secs.
=> It also happens sometimes if the header is open but not the cpp.
=> This does not happen any more if the header file is already open.
hello,
any plans to add this patch to nightly build ?
Read the topic from the beginning. :)//scratching my head
Read the topic from the beginning. :)//scratching my head
i did, that's why i applied the patch to see if it would work "good enough" on my small projects. Not sure how to enable the browser..
@tiger,In my builds I used wx3.1.3 compiler with gcc.8.1.0._64bit . In Linux same wx version, compiler I just used the default one. The most complex part was to compile the special version of wx for Codeblocks.
How do i enable symbols browser with wx3 ? or, as the warning states, it will crash and burn the app?
I really would not want to go back to wx2 - the look&feel is so dated :(
I applied the patch to latest nightly 12040
To be honest, I did not note a big difference between CB with wx2.8/wx3.0.His wxgtk3 is probably using gtk3 and that is why he is seeing this "non-dated" look. :)
@tiger,In my builds I used wx3.1.3 compiler with gcc.8.1.0._64bit . In Linux same wx version, compiler I just used the default one. The most complex part was to compile the special version of wx for Codeblocks.
How do i enable symbols browser with wx3 ? or, as the warning states, it will crash and burn the app?
I really would not want to go back to wx2 - the look&feel is so dated :(
I applied the patch to latest nightly 12040
I can not recall any compile errors. Once it started it went though ok. Also I can not remember any evil warnings, but I did not check the build log really.
In my case the symbol browser was enabled already. If not check Menu/Settings/Editor/CodeCompletion/SymbolBrowser. If you do not have an enabled checkbox to enable/disable Symbol browser, something might have gone wrong when applying the patch to the sources before compiling.
It did not crash and the only things I found I listed above. Not sure what you mean with "burn the app".
To be honest, I did not note a big difference between CB with wx2.8/wx3.0.
Help it helps.
rpm -qa | grep gtk
PackageKit-gtk3-module-1.1.12-8.fc30.x86_64
libindicator-gtk3-12.10.1-14.fc30.x86_64
bluebird-gtk3-theme-1.3-2.fc30.noarch
clutter-gtk-1.8.4-5.fc30.x86_64
compat-wxGTK3-gtk2-devel-3.0.4-8.fc30.x86_64
greybird-gtk2-theme-3.22.10-1.fc30.noarch
ibus-gtk2-1.5.20-5.fc30.x86_64
gtk2-2.24.32-6.fc30.x86_64
gtk2-devel-2.24.32-6.fc30.x86_64
gtkmathview-0.8.0-27.fc30.x86_64
webkit2gtk3-jsc-2.28.0-6.fc30.x86_64
gtkspell-2.0.16-18.fc30.x86_64
compat-wxGTK3-gtk2-3.0.4-8.fc30.x86_64
bluebird-gtk2-theme-1.3-2.fc30.noarch
lightdm-gtk-2.0.5-3.fc30.x86_64
greybird-gtk3-theme-3.22.10-1.fc30.noarch
albatross-gtk3-theme-1.7.4-6.fc30.noarch
webkit2gtk3-2.28.0-6.fc30.x86_64
gtk3-devel-3.24.11-1.fc30.x86_64
libreoffice-gtk3-6.2.8.2-2.fc30.x86_64
gstreamer1-plugins-good-gtk-1.16.0-1.fc30.x86_64
libpeas-gtk-1.22.0-10.fc30.x86_64
libcanberra-gtk3-0.30-19.fc30.x86_64
gtk-xfce-engine-3.2.0-9.fc30.x86_64
transmission-gtk-2.94-6.fc30.x86_64
albatross-gtk2-theme-1.7.4-6.fc30.noarch
libreport-gtk-2.12.0-1.fc30.x86_64
gtk-unico-engine-1.0.3-0.13.20140109bzr152.fc30.x86_64
pygtk2-2.24.0-25.fc30.x86_64
gtk-murrine-engine-0.98.2-16.fc30.x86_64
gtksourceview3-3.24.11-1.fc30.x86_64
gtk-update-icon-cache-3.24.11-1.fc30.x86_64
libappindicator-gtk3-12.10.0-24.fc30.x86_64
compat-wxGTK3-gtk2-gl-3.0.4-8.fc30.x86_64
adwaita-gtk2-theme-3.28-5.fc30.x86_64
gtkmm30-3.24.2-1.fc30.x86_64
gtk3-3.24.11-1.fc30.x86_64
ibus-gtk3-1.5.20-5.fc30.x86_64
colord-gtk-0.1.26-11.fc30.x86_64
libdbusmenu-gtk3-16.04.0-11.fc30.x86_64
compat-wxGTK3-gtk2-media-3.0.4-8.fc30.x86_64
gtk2-engines-2.20.2-18.fc30.x86_64
xdg-user-dirs-gtk-0.10-15.fc30.x86_64
<skipped>
Building target platforms: x86_64
Building for target x86_64
Wrote: /builddir/build/SRPMS/codeblocks-20.03.svn.12045-1.fc30.src.rpm
Child return code was: 0
ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/codebloc
ks.spec'], chrootPath='/var/lib/mock/fedora-30-x86_64/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOST
NAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-ch
root> \\s-\\v\\$ ', 'LANG': 'en_US.utf8'}shell=Falselogger=<mockbuild.trace_decorator.getLog object at 0x7fa39c1c5c50>timeout=0ui
d=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.t9ehylqn:/etc/resolv.conf', '--bi
nd=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '
--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--
bind=/dev/loop11']unshare_net=TrueprintOutput=True)
Using nspawn with args ['--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.t9ehylqn:/etc/resolv.conf', '--bind=/dev/loop-contr
ol', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5'
, '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']
Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'c6daa95895f642f298141ca5a7752a01', '-D', '/var/lib/mock/fedora-30-x86
_64/root', '-a', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.t9ehylqn:/etc/resolv.conf', '--bind=/dev/loop-control', '-
-bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bi
nd=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--set
env=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/u
sr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;<mock-chroot>\\007"', '--setenv=PS1=<mock-chroot> \\s-\\v\\$ ', '--seten
v=LANG=en_US.utf8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/S
PECS/codeblocks.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bi
n:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'en
_US.utf8'} and shell False
Building target platforms: x86_64
Building for target x86_64
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7JoSBB
umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf codeblocks-17.12.svn/trunk
+ /usr/bin/gzip -dc /builddir/build/SOURCES/codeblocks-20.03.svn.12045.tar.bz2
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd codeblocks-17.12.svn/trunk
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
Patch #0 (symbol_browser.patch):
+ echo 'Patch #0 (symbol_browser.patch):'
+ /usr/bin/patch --no-backup-if-mismatch -p0 --fuzz=0
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/ccoptionsdlg.cpp
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/cctreectrl.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/classbrowser.cpp
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/classbrowserbuilderthread.cpp
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/classbrowserbuilderthread.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/codecompletion.cpp
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/plugins/codecompletion/nativeparser.cpp
+ ./bootstrap
Found revision: '0' ''
rm: missing operand
Try 'rm --help' for more information.
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:26: installing './compile'
configure.ac:7: installing './config.guess'
configure.ac:7: installing './config.sub'
configure.ac:22: installing './install-sh'
configure.ac:22: installing './missing'
src/base/tinyxml/Makefile.am: installing './depcomp'
+ find . -type f -and -not -name '*.cpp' -and -not -name '*.h' -and -not -name '*.png' -and -not -name '*.bmp' -and -not -name '*
.c' -and -not -name '*.cxx' -and -not -name '*.ico' -exec dos2unix -q --keepdate '{}' ';'
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.rfi2F2
umask 022
+ cd /builddir/build/BUILD
+ cd codeblocks-17.12.svn/trunk
<skipped>
checking whether to use gtk-notebook as default notebook... yes
checking which (if any) contrib plugins to build... all
checking if the compiler supports precompiled headers... yes
checking for wx-config... /usr/bin/wx-config
checking for wxWidgets version >= 2.8.12... yes (version 3.0.4)
checking for wxWidgets static library... no
checking for wxWidgets platform... wxGTK
checking for GLIB2... yes
checking for HUNSPELL... yes
configure: gtk3 used
checking for GTK... yes
configure: gdk3 used
checking for GDK... yes
checking for GAMIN... yes
checking for FONTCONFIG... yes
checking for boostlib >= (102000)... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
checking for X... libraries , headers
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking gcc version... 9
checking for wxWidgets >= 2.9.0... yes (version 3.0.4)
configure: (Re)setting libs for wxWidgets 3.0.4
checking for PIC flags... "-fPIC -DPIC"
checking whether g++ supports C++11 features by default... yes
configure: Configuring Code::Blocks...
configure: SVN revision 20.03svn0 ()
checking that generated files are newer than configure... done
configure: creating ./config.status
<skip>
config.status: creating src/plugins/codecompletion/Makefile
config.status: creating src/plugins/codecompletion/resources/Makefile
<skip>
make[3]: Entering directory '/builddir/build/BUILD/codeblocks-17.12.svn/trunk/src/plugins/codecompletion'
Making all in resources
make[4]: Entering directory '/builddir/build/BUILD/codeblocks-17.12.svn/trunk/src/plugins/codecompletion/resources'
<skip>
make[4]: Leaving directory '/builddir/build/BUILD/codeblocks-17.12.svn/trunk/src/plugins/codecompletion/resources'
make[4]: Entering directory '/builddir/build/BUILD/codeblocks-17.12.svn/trunk/src/plugins/codecompletion'
<skip>
In file included from parser/parserthread.h:21,
from parser/parser.h:22,
from cctreectrl.h:13,
from cctreectrl.cpp:20:
parser/parserthread.h: In member function 'virtual int ParserThread::Execute()':
parser/cclogger.h:161:18: warning: unused variable 'result' [-Wunused-variable]
161 | auto result = M.Lock(); \
| ^~~~~~
parser/parserthread.h:190:9: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_LOCK'
190 | CC_LOCKER_TRACK_TT_MTX_LOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
parser/cclogger.h:167:18: warning: unused variable 'result' [-Wunused-variable]
167 | auto result = M.Unlock(); \
| ^~~~~~
parser/parserthread.h:194:9: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_UNLOCK'
194 | CC_LOCKER_TRACK_TT_MTX_UNLOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib64/wx/include/gtk3
-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../src/include -I../../../src
/sdk/wxscintilla/include -DCB_AUTOCONF -DCB_PRECOMP -DPIC -DTIXML_USE_STL=YES -O2 -g -pipe -Wall -Werror=format-security -Wp,-
D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redh
at/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-cla
sh-protection -fcf-protection -Winvalid-pch -fPIC -fexceptions -c -o classbrowserbuilderthread.lo classbrowserbuilderthread.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib64/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0
-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../src/include -I../../../src/sdk/wxscintilla/include -DCB_AUTOC
ONF -DCB_PRECOMP -DPIC -DTIXML_USE_STL=YES -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSE
RTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib
/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Winvali
d-pch -fPIC -fexceptions -c classbrowserbuilderthread.cpp -fPIC -DPIC -o .libs/classbrowserbuilderthread.o
In file included from parser/parserthread.h:21,
from parser/parser.h:22,
from nativeparser.h:10,
from ccoptionsprjdlg.h:12,
from ccoptionsprjdlg.cpp:27:
parser/parserthread.h: In member function 'virtual int ParserThread::Execute()':
parser/cclogger.h:161:18: warning: unused variable 'result' [-Wunused-variable]
161 | auto result = M.Lock(); \
| ^~~~~~
parser/parserthread.h:190:9: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_LOCK'
190 | CC_LOCKER_TRACK_TT_MTX_LOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
parser/cclogger.h:167:18: warning: unused variable 'result' [-Wunused-variable]
167 | auto result = M.Unlock(); \
| ^~~~~~
parser/parserthread.h:194:9: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_UNLOCK'
194 | CC_LOCKER_TRACK_TT_MTX_UNLOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib64/wx/include/gtk3
-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../src/include -I../../../src
/sdk/wxscintilla/include -DCB_AUTOCONF -DCB_PRECOMP -DPIC -DTIXML_USE_STL=YES -O2 -g -pipe -Wall -Werror=format-security -Wp,-
D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redh
at/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-cla
sh-protection -fcf-protection -Winvalid-pch -fPIC -fexceptions -c -o codecompletion.lo codecompletion.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib64/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0
-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../../../src/include -I../../../src/sdk/wxscintilla/include -DCB_AUTOC
ONF -DCB_PRECOMP -DPIC -DTIXML_USE_STL=YES -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSE
RTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib
/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Winvali
d-pch -fPIC -fexceptions -c codecompletion.cpp -fPIC -DPIC -o .libs/codecompletion.o
n file included from parser/parserthread.h:21,
from parser/parser.h:22,
from cctreectrl.h:13,
from classbrowser.h:15,
from classbrowser.cpp:43:
parser/parserthread.h: In member function 'virtual int ParserThread::Execute()':
parser/cclogger.h:161:18: warning: unused variable 'result' [-Wunused-variable]
161 | auto result = M.Lock(); \
| ^~~~~~
parser/parserthread.h:190:9: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_LOCK'
190 | CC_LOCKER_TRACK_TT_MTX_LOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
parser/cclogger.h:167:18: warning: unused variable 'result' [-Wunused-variable]
167 | auto result = M.Unlock(); \
| ^~~~~~
parser/parserthread.h:194:9: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_UNLOCK'
194 | CC_LOCKER_TRACK_TT_MTX_UNLOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
classbrowser.cpp: In member function 'void ClassBrowser::OnTreeItemDoubleClick(wxTreeEvent&)':
parser/cclogger.h:161:18: warning: unused variable 'result' [-Wunused-variable]
161 | auto result = M.Lock(); \
| ^~~~~~
classbrowser.cpp:558:13: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_LOCK'
558 | CC_LOCKER_TRACK_TT_MTX_LOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
parser/cclogger.h:167:18: warning: unused variable 'result' [-Wunused-variable]
167 | auto result = M.Unlock(); \
| ^~~~~~
classbrowser.cpp:563:13: note: in expansion of macro 'CC_LOCKER_TRACK_TT_MTX_UNLOCK'
563 | CC_LOCKER_TRACK_TT_MTX_UNLOCK(s_TokenTreeMutex)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
classbrowser.cpp: In member function 'void ClassBrowser::OnSearch(wxCommandEvent&)':
parser/cclogger.h:161:18: warning: unused variable 'result' [-Wunused-variable]
161 | auto result = M.Lock(); \
| ^~~~~~
...
Why did you post a picture of Code Completion plugin status?I'm afraid that is not really helpful. In CB16.0 the Symbol Table Plugin is version 1.0, in my patched 17 version it is still 1.0. Thats not really a surprise, when the only difference is some changed functions. It has not been an official plugin update, so so surprise that the version number was not touched, is it?
Did you even check the status of the Symbol Table plugin?
<mock-chroot> sh-5.0# ls -l ../BUILD/codeblocks-17.12.svn/trunk/src/plugins/codecompletion/ccoptionsdlg.cpp
-rw-r--r-- 1 mockbuild mock 23731 Apr 11 19:11 ../BUILD/codeblocks-17.12.svn/trunk/src/plugins/codecompletion/ccoptionsdlg.cpp
tar -tzvf codeblocks-20.03.svn.12045.tar.bz2 | grep ccoptionsdlg.cpp
-rw-rw-r-- az/az 24356 2019-11-24 13:58 ./codeblocks-17.12.svn/trunk/src/plugins/codecompletion/ccoptionsdlg.cpp
# %%global svnrev @REVISION@
%global svnrev 12045
%global VERSION 20.03
Name: codeblocks
Version: %{VERSION}.svn.%{svnrev}
Release: 1%{?dist}
Summary: An open source, cross platform, free C++ IDE
License: GPLv3+
URL: http://www.codeblocks.org/
Source0: %{name}-%{VERSION}.tar.bz2
# Source0: %%{name}-17.12.svn.tar.bz2
Patch0: symbol_browser.patch
BuildRequires: libtool
BuildRequires: wxGTK3-devel
<skip>
%prep
%setup -q -n %{name}-17.12.svn/trunk
# %%setup -q -n %{name}-@VERSION@
%patch0 -p0
./bootstrap
# convert EOLs
find . -type f -and -not -name "*.cpp" -and -not -name "*.h" -and -not -name "*.png" -and -not -name "*.bmp" -and -not -name "*.c
" -and -not -name "*.cxx" -and -not -name "*.ico" -exec dos2unix -q --keepdate {} \;
%build
%configure \
--with-contrib-plugins=all \
--with-boost-libdir=%{_libdir}
Yep, there was some old code somewhere. Now i can see the browser. Excellent.Glad it worked.
Yep, there was some old code somewhere. Now i can see the browser. Excellent.Glad it worked.
Should you have feedback or additional findings on the patch please collect it in this thread.
Status
A volunteer is neeed to run a profiler and to do the initial measurements in CodeBlocks.
The total timing of the SymbolBrowser in the mean thread (and only in the main thread) is needed. All timings of the threads may be ignored. As I understaood the measurement should cover the times if SymbolBrowser is active and well as when it is not active (e.g. another management tab is open). Please post the results in this thead.
(codeblocks:126954): Gtk-CRITICAL **: 18:52:31.070: gtk_tree_model_iter_nth_child: assertion 'n >= 0' failed
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
18:52:48: Debug: window wxScintilla(0x56207fc408a0, ) lost focus even though it didn't have it
-- terminating the app and i see the below
18:53:22: Debug: 3 threads were not terminated by the application.
If the application is crashing you have to use a debugger to see where.
I have just created a ticket with the new fully threaded implementation, patch is there.Thanks a lot for your effort!
I have just created a ticket with the new fully threaded implementation, patch is there.
https://sourceforge.net/p/codeblocks/tickets/1031/ (https://sourceforge.net/p/codeblocks/tickets/1031/)
Does the patch work correctly for you?Yes.
What does pre-release means? Why don't you just call it "custom version"?
void ClassBrowser:CollapseItem(CCTreeItem* item)
void ClassBrowser::CollapseItem(CCTreeItem* item)
compiling current trunk fails due to a syntax error in classbrowser.cpp:1188This is fixed in sVN-trunk but I wonder if CC_NO_COLLAPSE_ITEM is still needed... Maybe I should give it a shot...
[...]
classbrowser.cpp: In member function ‘void ClassBrowser::CollapseItem(CCTreeItem*)’:
classbrowser.cpp:1188:33: error: no matching function for call to ‘ClassBrowser::GetId(CCTreeItem*&)’
wxTreeItemId Id = GetId(item);
^
In file included from /usr/include/wx-3.0/wx/wx.h:38:0,
from /usr/include/wx-3.0/wx/wxprec.h:58,
from ./sdk_common.h:24,
from ./sdk_precomp.h:13,
from ./sdk.h:17:
/usr/include/wx-3.0/wx/window.h:241:16: note: candidate: wxWindowID wxWindowBase::GetId() const
wxWindowID GetId() const { return m_windowId; }
^~~~~
classbrowser.cpp: In member function ‘void ClassBrowser::CollapseItem(CCTreeItem*)’:
classbrowser.cpp:1188:33: error: no matching function for call to ‘ClassBrowser::GetId(CCTreeItem*&)’
wxTreeItemId Id = GetId(item);
^
In file included from /usr/include/wx-3.0/wx/wx.h:38:0,
from /usr/include/wx-3.0/wx/wxprec.h:58,
from ./sdk_common.h:24,
from ./sdk_precomp.h:13,
from ./sdk.h:17:
/usr/include/wx-3.0/wx/window.h:241:16: note: candidate: wxWindowID wxWindowBase::GetId() const
wxWindowID GetId() const { return m_windowId; }
^~~~~
It is a minor optimization trading memory for speed, but hardly noticeable.