Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml
Before you use a nightly make sure you understand how it works (http://forums.next.codeblocks.org/index.php/topic,3232.0.html).
A link to the unicode windows wxWidget dll for Code::Blocks : http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc441.7z
For those who might need this one (when no MingW installed on your system) : the mingw10m.dll : http://prdownload.berlios.de/codeblocks/mingwm10_gcc441.7z
The 19 September 2010 build is out.
- Windows :
http://prdownload.berlios.de/codeblocks/CB_20100919_rev6608_CC_BRANCH_win32.7z
- Linux :
none
Important changes compared to previous CODECOMPLETION BRANCH nightly:
* cc_branch: applied patch to imrpove nightly build (v2):
- make system header files code-completion configurable
- enhance performance by CC member variables
- fixed switch parser error
- add some debug log
* cc_branch: applied patch to fix a crash in batch parse (v8)
* cc_branch: applied patch to fix hangs in linux
* cc_branch: applied patch to redesign the one-by-one parser AND improve the protection of critical section
* cc_branch: applied patch to fix bug of scope selection failed in linux.
* cc_branch: applied patch to fix several possible crash candidates
* all updates that occurred on trunk
THIS IS A SPECIAL TEST BUILD OF REFACTORINGS CARRIED OUT ON THE CODE COMPLETION BRANCH IN OUR SVN.
FOCUS IS ON ENHANCED CODE COMPLETION USABILITY.
Give your feedback on this version only in this thread, don't mix it with the regular nightly please.
Once we don't have any blockers on this version,we will merge the changes into trunk and it will be part of the regular nightlies.
link to file on top of page is to prev nightly release
pls update
thanks, fixed.
Under windows, there is a bug can't fixed yet. (this bug seems does not happened under linux)
Steps to proudce it:
1, open the contribute. workspace
2, double click on a project
3, then double click on another project to active another project.
4, continue the step 3 about more then 10 times, then cb will crash.
Can some one help us or give a direction? thanks.
crash always happens to the code:
Nativeparser.cpp
if ( project
&& (type == ptCreateParser || type == ptAddFileToParser) )
{
for (int i = 0; i < project->GetFilesCount(); ++i)
{
ProjectFile* pf = project->GetFile(i);
if (CCFileTypeOf(pf->relativeFilename) != ftOther)
parser->MarkFileTokensAsLocal(pf->file.GetFullPath(), true, project);
}
}
the line:
parser->MarkFileTokensAsLocal(pf->file.GetFullPath(), true, project);
thanks.
Quote from: ollydbg on September 19, 2010, 12:55:12 PM
Under windows, there is a bug can't fixed yet. (this bug seems does not happened under linux)
Steps to proudce it:
1, open the contribute. workspace
2, double click on a project
3, then double click on another project to active another project.
4, continue the step 3 about more then 10 times, then cb will crash.
crash report like this:
QuoteError occured on Sunday, September 19, 2010 at 14:05:11.
D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe caused an Access Violation at location 65ede6ed in module D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll Reading from location 103f5070.
Registers:
eax=103f5070 ebx=00000001 ecx=00000000 edx=00000000 esi=65ec808a edi=021217a0
eip=65ede6ed esp=0022f7f8 ebp=0022f830 iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010202
Call stack:
65EDE6ED D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65EDE6ED
65EDE9A6 D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65EDE9A6
65EDF50A D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65EDF50A
65EE4D93 D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65EE4D93
65EE4E77 D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65EE4E77
65ECE64D D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65ECE64D
65EC865D D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65EC865D
68502BC9 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:68502BC9 _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
68504651 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:68504651 _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler
68504728 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:68504728 _ZN12wxEvtHandler12ProcessEventER7wxEvent
65ED128A D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65ED128A
65ED034E D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll:65ED034E
68502BC9 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:68502BC9 _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
68502D10 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:68502D10 _ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent
685046F7 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:685046F7 _ZN12wxEvtHandler12ProcessEventER7wxEvent
6850416E D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:6850416E _ZN12wxEvtHandler20ProcessPendingEventsEv
684815A8 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:684815A8 _ZN12wxAppConsole20ProcessPendingEventsEv
688837C6 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:688837C6 _ZN18wxHtmlSearchEngineD1Ev
77D2B372 C:\WINDOWS\system32\USER32.dll:77D2B372 MoveWindow
77D2B317 C:\WINDOWS\system32\USER32.dll:77D2B317 MoveWindow
77D278D0 C:\WINDOWS\system32\USER32.dll:77D278D0 GetWindowTextLengthW
7C92E473 C:\WINDOWS\system32\ntdll.dll:7C92E473 KiUserCallbackDispatcher
68536683 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:68536683 _ZN11wxEventLoop8DispatchEv
685CA58E D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:685CA58E _ZN17wxEventLoopManual3RunEv
685A9B9B D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:685A9B9B _ZN9wxAppBase8MainLoopEv
0040441C D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe:0040441C
684B389D D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:684B389D _Z12wxInitializeiPPw
6850A487 D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:6850A487 _Z7wxEntryP11HINSTANCE__S0_Pci
00401AA7 D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe:00401AA7 WinMain@16 D:/DengYC/CodeBlocks-svn/src/src/app.cpp:261
004543A6 D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe:004543A6
004010DB D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe:004010DB
00401158 D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe:00401158
7C817077 C:\WINDOWS\system32\kernel32.dll:7C817077 RegisterWaitForInputIdle
After call Addr2Line, here is more info:
Quote******************************
* Found (another) call stack *
******************************
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65EDE6ED:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65EDE6ED]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/searchtree.cpp:584
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65EDE9A6:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65EDE9A6]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/searchtree.cpp:652
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65EDF50A:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65EDF50A]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/searchtree.cpp:816
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65EE4D93:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65EE4D93]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/token.cpp:1261
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65EE4E77:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65EE4E77]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/token.cpp:1285
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65ECE64D:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65ECE64D]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/parser.cpp:328
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65EC865D:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65EC865D]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/nativeparser.cpp:3292
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 68502BC9:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[68502BC9]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 68504651:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[68504651]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 68504728:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[68504728]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65ED128A:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65ED128A]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/parser.cpp:1125
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll 65ED034E:
D:\DengYC\CodeBlocks-svn\src\devel\share\codeblocks\plugins\codecompletion.dll[65ED034E]:
D:/DengYC/CodeBlocks-svn/src/plugins/codecompletion/parser/parser.cpp:883
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 68502BC9:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[68502BC9]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 68502D10:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[68502D10]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 685046F7:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[685046F7]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 6850416E:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[6850416E]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 684815A8:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[684815A8]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 688837C6:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[688837C6]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e C:\WINDOWS\system32\USER32.dll 77D2B372:
C:\WINDOWS\system32\USER32.dll[77D2B372]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e C:\WINDOWS\system32\USER32.dll 77D2B317:
C:\WINDOWS\system32\USER32.dll[77D2B317]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e C:\WINDOWS\system32\USER32.dll 77D278D0:
C:\WINDOWS\system32\USER32.dll[77D278D0]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e C:\WINDOWS\system32\ntdll.dll 7C92E473:
C:\WINDOWS\system32\ntdll.dll[7C92E473]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 68536683:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[68536683]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 685CA58E:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[685CA58E]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 685A9B9B:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[685A9B9B]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe 0040441C:
D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe[0040441C]:
D:/DengYC/CodeBlocks-svn/src/src/app.cpp:781
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 684B389D:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[684B389D]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll 6850A487:
D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll[6850A487]:
??:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe 00401AA7:
D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe[00401AA7]:
D:/DengYC/CodeBlocks-svn/src/src/app.cpp:261
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe 004543A6:
D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe[004543A6]:
scriptingsettingsdlg.cpp:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe 004010DB:
D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe[004010DB]:
scriptingsettingsdlg.cpp:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe 00401158:
D:\DengYC\CodeBlocks-svn\src\devel\codeblocks.exe[00401158]:
scriptingsettingsdlg.cpp:0
----------------------------------------
D:\DengYC\CodeBlocks-svn\src\devel\build\gcc\bin\addr2line.exe -e C:\WINDOWS\system32\kernel32.dll 7C817077:
C:\WINDOWS\system32\kernel32.dll[7C817077]:
??:0
[I don't speak english]
* The 19 september 2010 build (6608) CODECOMPLETION BRANCH version is out.
syntax highlight problem (no bug)
(platform: win7 x64)
#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) << color => blue
# undef TOTO << color => blue
# ifdef __GNUG__ << color => blue
# define TOTO 1234 << color => ... black?
# else << color => blue
# define TOTO 4321 << color => blue
# endif << color => blue
#endif << color => blue
//--------------
#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) << color => blue
# undef TOTO << color => blue
# if defined __GNUG__ << color => blue
# define TOTO 1234 << color => blue
# else << color => blue
# define TOTO 4321 << color => ... black?
# endif << color => blue
#endif << color => blue
Quote from: imnotcb on September 20, 2010, 01:20:22 AM
[I don't speak english]
* The 19 september 2010 build (6608) CODECOMPLETION BRANCH version is out.
syntax highlight problem (no bug)
#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) << color => blue
# undef TOTO << color => blue
# ifdef __GNUG__ << color => blue
# define TOTO 1234 << color => ... black?
# else << color => blue
# define TOTO 4321 << color => blue
# endif << color => blue
#endif << color => blue
//--------------
#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) << color => blue
# undef TOTO << color => blue
# if defined __GNUG__ << color => blue
# define TOTO 1234 << color => blue
# else << color => blue
# define TOTO 4321 << color => ... black?
# endif << color => blue
#endif << color => blue
HI, imnotcb, the "no-bug" example shows "as" the __GNUG__ is defined.
The later example shows that this macro is not defined.
The syntax highlight is done by the scintilla control, I'm not sure how it works.
CodeCompletion plugin currently not support the syntax highlight. (but CodeCompletion plugin do parse these preprocessor)
it's possibly a bug because: ifdef == if defined
look my example again
@Loaden, I can not reproduce the crash, but face another bug:
if no file is open, the symbols-browser does not show anything (except the default symbols: Global functions, etc.) or the last shown entries, if at least one file was open and now all files are closed, after reparsing with no files open the symbols-browser is cleared (reparse-now from sb's ciontext-menu).
Quote from: jens on September 21, 2010, 12:26:35 AM
@Loaden, I can not reproduce the crash, but face another bug:
if no file is open, the symbols-browser does not show anything (except the default symbols: Global functions, etc.) or the last shown entries, if at least one file was open and now all files are closed, after reparsing with no files open the symbols-browser is cleared (reparse-now from sb's ciontext-menu).
Thank you, I have found the reason and fixed soon!
1. Fix a crash under windows
2. Member variable of the unified style of naming
3. Now NativeParser::GetParser return reference always
4. Parser instance of removing unnecessary
5. Parser to the active editor is never removed
6. Refactoring some variable names, function names
Quote from: Loaden on September 21, 2010, 06:42:08 AM
1. Fix a crash under windows
2. Member variable of the unified style of naming
3. Now NativeParser::GetParser return reference always
4. Parser instance of removing unnecessary
5. Parser to the active editor is never removed
6. Refactoring some variable names, function names
I can confirm the crash problem I reported in this thread was gone!
Nice work, Loaden!!!
Ok guys, i need urgent help. I'm having this issue with CodeCompletion. It's the "Open header file" function. It was not working in my official release of CB 10.05, so i downloaded this one: http://prdownload.berlios.de/codeblocks/CB_20100919_rev6608_CC_BRANCH_win32.7z
but its still not working! It worked first but not anymore. I think u should review the code lines about this, cause this bug is annoying me a lot......
Quote from: helpse on September 21, 2010, 08:46:28 AM
It worked first but not anymore. I think u should review the code lines about this, cause this bug is annoying me a lot......
My friend, what's the exact problem you have? Can you explain more???
Hopefully you should give us a minimal sample test code.
1. Fix *NONE* project parser error
2. Add parse any files opened through DDE or the command-line
I can not open header files located in the same directory where my cpp file is. It gives me "not found" error when i use "open #include file" function. I think it's, as Loaden said, NONE project parser error. I tried to apply the patch but my SVN gives me this error: "The patch seems outdated! i tried updating the SVN project to 6620 and to 6608, and its still giving me this error when i try to apply the patch. What can i do to be able to apply the patch ?
Quote from: helpse on September 21, 2010, 05:07:46 PM
I can not open header files located in the same directory where my cpp file is. It gives me "not found" error when i use "open #include file" function. I think it's, as Loaden said, NONE project parser error. I tried to apply the patch but my SVN gives me this error: "The patch seems outdated! i tried updating the SVN project to 6620 and to 6608, and its still giving me this error when i try to apply the patch. What can i do to be able to apply the patch ?
I can not reproduce.
Can you give a sample project, where the issue occurs ?
And please post the exact version number, OS, wxWidgets, compiler version ...
Sample code:
#include <iostream>
#include "console"
using namespace std;
using namespace console;
int main()
{
cout << "Hello!" ;
return 0;
}
console is a header file located in the same directory. It compiles and runs OK. The error ocurres when i right click on "console" and click on "open #include file". I get "Not found" error. The weird thing is that it happens 99% of the times, sometimes it works. It was happenning in the official release of CB 10.05, the one downloaded from the official page, so i downloaded this CC branch, http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc441.7z (http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc441.7z) and i still have the same problem. I'm using Windows 7 Ultimate, i'm trying to compile wxWidgets 2.9.1, and im using gcc 4.5.0, the one downloaded from the main page.
Quote from: helpse on September 21, 2010, 05:07:46 PM
I can not open header files located in the same directory where my cpp file is. It gives me "not found" error when i use "open #include file" function. I think it's, as Loaden said, NONE project parser error. I tried to apply the patch but my SVN gives me this error: "The patch seems outdated! i tried updating the SVN project to 6620 and to 6608, and its still giving me this error when i try to apply the patch. What can i do to be able to apply the patch ?
Could you trying CC BRANCH SVN 6621?
It shoud be fixed.
Quote from: helpse on September 22, 2010, 12:13:09 AM
Sample code:
#include <iostream>
#include "console"
using namespace std;
using namespace console;
int main()
{
cout << "Hello!" ;
return 0;
}
console is a header file located in the same directory.
I just test your example, and works fine here( ccbranch 6621, windowsXP)
Quote from: helpse on September 22, 2010, 12:13:09 AM
Sample code:
#include <iostream>
#include "console"
using namespace std;
using namespace console;
int main()
{
cout << "Hello!" ;
return 0;
}
console is a header file located in the same directory. It compiles and runs OK. The error ocurres when i right click on "console" and click on "open #include file". I get "Not found" error. The weird thing is that it happens 99% of the times, sometimes it works. It was happenning in the official release of CB 10.05, the one downloaded from the official page, so i downloaded this CC branch, http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc441.7z (http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc441.7z) and i still have the same problem. I'm using Windows 7 Ultimate, i'm trying to compile wxWidgets 2.9.1, and im using gcc 4.5.0, the one downloaded from the main page.
Fixed, thanks!
Thank you, i think u looked into the error and fixed it. May be some of u can compile CC Branch SVN 6621 for those who, like me, are having troubles trying to install wxwidget to work with CB project. Can any1 compile and upload it? I wanna test to see if the code works for me too.
Quote from: helpse on September 22, 2010, 03:50:09 AM
Thank you, i think u looked into the error and fixed it. May be some of u can compile CC Branch SVN 6621 for those who, like me, are having troubles trying to install wxwidget to work with CB project. Can any1 compile and upload it? I wanna test to see if the code works for me too.
Please trying and feedback me.
Thanks!
http://portablecb.googlecode.com/files/CB_CCBRANCH_6621_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6621_patched.7z)
Quote from: Loaden on September 22, 2010, 04:02:12 AM
Quote from: helpse on September 22, 2010, 03:50:09 AM
Thank you, i think u looked into the error and fixed it. May be some of u can compile CC Branch SVN 6621 for those who, like me, are having troubles trying to install wxwidget to work with CB project. Can any1 compile and upload it? I wanna test to see if the code works for me too.
Please trying and feedback me.
Thanks!
http://portablecb.googlecode.com/files/CB_CCBRANCH_6621_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6621_patched.7z)
Thank you Loaden and all the guys who supported. Now this problem is fixed ;)
Fix a hangs when reparse.
2010-09-22 19:31:53 Sorry, this patch can not let's the hangs gone. So, I deleted this patch, and will look into it.
2010-09-22 21:15:53 fixed, re-upload patch.
Found a new bug. Single files which dont belong to a project dont get to compile cause they arent getting linked to the libraries setted up in Settings -> Compiler & Settings -> Linker Settings. They only compile when they are inside a project.
Code Sample:
#define UNICODE
#include "..\cGui.h"
using namespace std;
class cMainForm
{
void Button_Clicked()
{
AlertUser( TEXT( "Button was clicked" ) );
}
cWindow < cMainForm > Window;
cButton < cMainForm > Button;
public:
cMainForm() : Window ( *this ),
Button ( Window )
{
Button.OnClicked = &cMainForm::Button_Clicked;
Window.SetName( TEXT( "Window" ) );
Window.DisableMaximize();
Window.DisableSizing();
int W = 200, H = 200;
Window.SetInnerSize( W, H );
int CenterX = W / 2;
int CenterY = H / 2;
Button.SetName( TEXT( "♠♣♥♦Button" ) );
Button.SetPos( CenterX - Button.GetWidth() / 2, CenterY - Button.GetHeight() / 2 );
int ScreenWidth = GetSystemMetrics( SM_CXSCREEN );
int ScreenHeight = GetSystemMetrics( SM_CYSCREEN );
Window.SetPos( ( ScreenWidth - W ) / 2, ( ScreenHeight - H ) / 2 );
Window.Show();
}
};
int main()
{
cMainForm MainForm;
return App.Run();
}
If u save it as a single file "Button_example.cpp" it wont compile, but if u create a project and u put that code in main.cpp, it compiles ok.
Linked libraries it uses: libcomctl32.a, libgdi32.a (They are setted up in Settings -> Compiler & Settings -> Linker Settings)
Im using the CC SVN 6621, and gcc 4.5.0.
Please, if u get to patch it, compile it for me so i can dl the compiled version. I couldnt configure wxwidgets yet, have been all day trying to solve compiler/IDE issues.
Thanks.
This is not CC issue. :)
B.T.W Works well for compile a single file for me.
A single file which uses libraries linked in Settings -> Compiler & Settings -> Linker Settings compiles ok? In my build it doesnt! May be u compiled a single file which "doesnt need libraries" such the ones i mentioned above. That code doesnt compile when its not inside a project, but the compiles if i create a project and put the code inside! The same code, works when its inside a project and doesnt work if i compile it as a single file... seems to be a bug :S
Quote from: helpse on September 22, 2010, 11:17:51 AM
A single file which uses libraries linked in Settings -> Compiler & Settings -> Linker Settings compiles ok? In my build it doesnt! May be u compiled a single file which "doesnt need libraries" such the ones i mentioned above. That code doesnt compile when its not inside a project, but the compiles if i create a project and put the code inside! The same code, works when its inside a project and doesnt work if i compile it as a single file... seems to be a bug :S
Are you aware that C::B compiles a single file with the compiler set as default compiler ?.
I just tested on trunk and it works fine here.
Im not touching compiler or linker settings. They are setted to default compiler, and in the linker options i have comctl32 and gdi32. A single code, which uses some of these libraries, cant compile. But this SAME CODE compiles when i put it into a project, which has SAME settings. Weird, isnt it ?
Quote from: helpse on September 22, 2010, 12:29:53 PM
Im not touching compiler or linker settings. They are setted to default compiler, and in the linker options i have comctl32 and gdi32. A single code, which uses some of these libraries, cant compile. But this SAME CODE compiles when i put it into a project, which has SAME settings. Weird, isnt it ?
Change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline" and compare the commands used to invoke the compiler.
Thanks. I did that. Here is what i get from compiling a project:
mingw32-g++.exe -Wall -g -c "C:\[Sergio]\C++\C++ Projects\test\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\test.exe obj\Debug\main.o -enable-auto-import -lcomctl32 -lgdi32
And from compiling a single file:
mingw32-g++.exe -c "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.cpp" -o "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.o"
mingw32-g++.exe -o "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.exe" "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.o"
Easy: It's just not linking the files i told it to link. I have comctl32 and gdi32 added to Compiler & Debugger -> Linker Settings. Dont forget to compile and upload it when u fix this bug, pls.
Quote from: helpse on September 22, 2010, 01:10:23 PM
Easy: It's just not linking the files i told it to link. I have comctl32 and gdi32 added to Compiler & Debugger -> Linker Settings. Dont forget to compile and upload it when u fix this bug, pls.
Please attach here or send me (via PM or mail) your project-file (just the cbp) and the default.conf of C::B.
Ok, here are the 2 files.
support member variable initialation codecompletion now
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
1. Simplified interface to batch parse
2. Improve batch parse performance
Improve system headers locker
Quote from: blueshake on September 22, 2010, 04:59:56 PM
support member variable initialation codecompletion now
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
Hi, blueshake, based you patch, I am fixed a bug.
Now, this patch shoud works well.
Hi, all!
I encountered a problem about scintilla.
Quotevoid CodeRefactoring::Find(cbStyledTextCtrl* control, const wxString& file, const wxString& target)
{
const int end = control->GetLength();
int start = 0;
int pos = 0;
for (;;)
{
int lengthFound;
pos = control->FindText(start, end, target, wxSCI_FIND_WHOLEWORD | wxSCI_FIND_MATCHCASE, &lengthFound);
if (pos != wxSCI_INVALID_POSITION)
{
start = pos + lengthFound;
// TODO (Loaden) not work?
const int style = control->GetStyleAt(pos); // always been zero?
if (control->IsString(style) || control->IsComment(style))
continue;
int line = control->LineFromPosition(pos);
wxString text = control->GetLine(line).Trim(true).Trim(false);
m_SearchDataMap[file].push_back(crSearchData(pos, line, text));
}
else
break;
}
}
Please see the bold style code, why the return value always been zero.
Any comment are welcome!
Ok, so i see its at revision 6627, but i cant compile it since i didnt configure wxwidgets yet. Could any1 compile and upload CB rev 6627? Thank you!
Quote from: helpse on September 23, 2010, 07:41:18 AM
Ok, so i see its at revision 6627, but i cant compile it since i didnt configure wxwidgets yet. Could any1 compile and upload CB rev 6627? Thank you!
Same as r6627.
http://portablecb.googlecode.com/files/CB_CCBRANCH_6623_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6623_patched.7z)
Or, waiting the next nightly build.
I just tried that 6623. The bug isn't fixed.
This is what i get from compiling a project:
mingw32-g++.exe -Wall -g -c "C:\[Sergio]\C++\C++ Projects\test\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\test.exe obj\Debug\main.o -enable-auto-import -lcomctl32 -lgdi32
And from compiling a single file:
mingw32-g++.exe -c "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.cpp" -o "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.o"
mingw32-g++.exe -o "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.exe" "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.o"
The difference is that when i build a project, it linkes the libraries i have setted in Compiler & Debugger -> Linker Settings. So it works fine.
But when i build a single file, with NO project, it doesnt link the libraries, and it SHOULD. The building log, for this case should be:
mingw32-g++.exe -c "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.cpp" -o "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.o"
mingw32-g++.exe -o "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.exe" "C:\[Sergio]\C++\cGui Library\Examples\Button_Example.o"
-enable-auto-import -lcomctl32 -lgdi32
That seems easy to fix...
I can confirm this, and it works on debugger-branch and trunk.
@helpse:
the enable-auto-import option should be: -Wl,--enable-auto-import .
It must has some thing wrong in this commit.
QuoteRevision: 6238
Author: mortenmacfly
Date: 2010-5-16 2:18:56
Message:
* applied patch "Fix compiler invalid bug, when the default compiler does not exist" (http://forums.next.codeblocks.org/index.php/topic,12351.0.html)
-------------------------------
M : /branches/codecompletion_refactoring/src/plugins/compilergcc/compilergcc.cpp
Quote from: jens on September 23, 2010, 11:28:17 AM
I can confirm this, and it works on debugger-branch and trunk.
@helpse:
the enable-auto-import option should be: -Wl,--enable-auto-import .
Hi, Jens, could you trying this patch?
The patch just to revert r6238.
If this patch can solved the issue, please commit it in cc branch, thanks!
@helpse
Could you trying this build?
http://portablecb.googlecode.com/files/CB_CCBRANCH_6627_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6627_patched.7z)
Fix system headers complete hangs.
Quote from: Loaden on September 23, 2010, 12:24:04 PM
Fix system headers complete hangs.
I see this in the patch:
+ return !!m_Locker;Before digging deeper into it: Is that what you want or a mistake?!
Quote from: Loaden on September 23, 2010, 12:18:52 PM
@helpse
Could you trying this build?
http://portablecb.googlecode.com/files/CB_CCBRANCH_6627_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6627_patched.7z)
Loaden, i just tried 6627, and my issue isnt solved yet. And my friend is having the same issue. The problem seems easy to me:
Single files are not linking the libraries setted in Compiler & Debugger -> Linker Settings.
The build log still remains the same:
mingw32-g++.exe -c "C:\[Sergio]\C++\C++ Projects\Matrix\console_test.cpp" -o "C:\[Sergio]\C++\C++ Projects\Matrix\console_test.o"
mingw32-g++.exe -o "C:\[Sergio]\C++\C++ Projects\Matrix\console_test.exe" "C:\[Sergio]\C++\C++ Projects\Matrix\console_test.o"
I found the cause and will commit a fix later.
Thanks. After u fix this bug, please also post a compiled version.
Quote from: helpse on September 23, 2010, 07:35:39 PM
Thanks. After u fix this bug, please also post a compiled version.
No !
Two reasons:
I do not compile on demand (I have a "real" life next to C::B and a job to earn my money and a family that comes first),
and second I do not compile windows versions (except for my own needs), just debian.
Ok. If u have time, commit a patch, and if u have time, post it.
I was asking for compiled versions cause i cant compile CB since i have not been able to build wxwidgets. It keeps getting me errors when i try. I think i will just use a wxpack.
Quote from: helpse on September 23, 2010, 09:01:41 PM
Ok. If u have time, commit a patch, and if u have time, post it.
I was asking for compiled versions cause i cant compile CB since i have not been able to build wxwidgets. It keeps getting me errors when i try. I think i will just use a wxpack.
Why not wait for the next nightly as all other users do ?
By the way the fix is comitted in svn r6631 (it was caused by parts of commit 6594 in compilercommmandgenerator.cpp), I also reverted commit 6629, that does not cause the issue.
EDIT:If you can not wxwidgets as described here (http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef) (more detailed) or here (http://wiki.codeblocks.org/index.php?title=Nightly_Cookbook#wxWidgets) you should find out what's going wrong, because compiling wxWidgets on windows is real trivial in my opinion.
Quote from: jens on September 23, 2010, 09:29:48 PM
By the way the fix is comitted in svn r6631 (it was caused by parts of commit 6594 in compilercommmandgenerator.cpp), I also reverted commit 6629, that does not cause the issue.
It is my fault, thank Jens! :(
I was needing it to be fixed cause CB isnt allowing me compile a single file. Anyways, thanks for looking into that issue.
Loaden, can u upload a compiled version of that 6631 for those of us who cant compile CB? Thank you.
And jens, i was trying to build wxwidgets following all those wiki pages, and no luck. Seems like wxwidgets is having troubles with recent versions of gcc, but well, thats matter of another post, not this one.
Some1 with some free time please post a compiled version. Thank you.
1. Add more comments (thank ollydbg)
2. Make headers code the same style
3. Remove "using namespace std" declaration
4. Remove some obsolete code
Here is the new portable build, enjoy! :D
http://portablecb.googlecode.com/files/CB_CCBRANCH_6631_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6631_patched.7z)
@killerbot
Can you take time out at the weekend and then publish a cc_branch build?
Thanks a lot!
@All
Now that we could not find some new issue have related cc branch.
After next nightly build, the feedback if there is no problem, I suggest merging with trunk (cc branch to trunk).
Quote from: Loaden on September 24, 2010, 04:19:52 AM
1. Add more comments (thank ollydbg)
2. Make headers code the same style
3. Remove "using namespace std" declaration
4. Remove some obsolete code
Here is the new portable build, enjoy! :D
http://portablecb.googlecode.com/files/CB_CCBRANCH_6631_patched.7z (http://portablecb.googlecode.com/files/CB_CCBRANCH_6631_patched.7z)
@killerbot
Can you take time out at the weekend and then publish a cc_branch build?
Thanks a lot!
@All
Now that we could not find some new issue have related cc branch.
After next nightly build, the feedback if there is no problem, I suggest merging with the trunk (cc branch to trunk).
Nice!
BTW:
the attachment file was wrong (file size =0K???) , you need to re-upload it again.
Quote from: ollydbg on September 24, 2010, 04:21:46 AM
BTW:
the attachment file was wrong (file size =0K???) , you need to re-upload it again.
Re-upload again. Thanks!
Thank you! Finally u fixed that bug.
all 3 nightlies coming this weekend :-)
Quote from: MortenMacFly on September 23, 2010, 05:48:06 PM
Quote from: Loaden on September 23, 2010, 12:24:04 PM
Fix system headers complete hangs.
I see this in the patch:
+ return !!m_Locker;
Before digging deeper into it: Is that what you want or a mistake?!
It just convert to bool.
It's i want.
This is C-ish style of coding, not very appropriate for C++.
If you can use != 0, != NULL or something like that it is better.
What is the type of m_Locker?
Quote from: oBFusCATed on September 24, 2010, 08:12:02 AM
This is C-ish style of coding, not very appropriate for C++.
If you can use != 0, != NULL or something like that it is better.
What is the type of m_Locker?
I just like this convertion. It's very simply. :?
Here is the completly code.
class SystemHeadersThread : public wxThread
{
public:
SystemHeadersThread(CodeCompletion* parent, SystemHeadersMap& headersMap, const wxArrayString& incDirs) :
m_Parent(parent),
m_SystemHeadersMap(headersMap),
m_IncludeDirs(incDirs)
{
Create();
SetPriority(WXTHREAD_MIN_PRIORITY);
}
virtual void* Entry()
{
wxArrayString dirs;
{
wxCriticalSectionLocker locker(s_HeadersCriticalSection);
for (size_t i = 0; i < m_IncludeDirs.GetCount(); ++i)
{
if (m_SystemHeadersMap.find(m_IncludeDirs[i]) == m_SystemHeadersMap.end())
{
dirs.Add(m_IncludeDirs[i]);
m_SystemHeadersMap[m_IncludeDirs[i]] = std::list<wxString>();
}
}
}
for (size_t i = 0; i < dirs.GetCount() && !TestDestroy(); ++i)
{
wxDir dir(dirs[i]);
if (!dir.IsOpened())
continue;
HeaderDirTraverser traverser(m_SystemHeadersMap, dirs[i]);
dir.Traverse(traverser, wxEmptyString, wxDIR_FILES | wxDIR_DIRS);
wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, THREAD_UPDATE);
evt.SetClientData(this);
evt.SetString(wxString::Format(_T("Get Headers: %s , %d"), dirs[i].wx_str(),
m_SystemHeadersMap[dirs[i]].size()));
wxPostEvent(m_Parent, evt);
}
if (!TestDestroy())
{
wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, THREAD_COMPLETED);
evt.SetClientData(this);
if (!dirs.IsEmpty())
evt.SetString(wxString::Format(_T("Get the system header file path: %d"), dirs.GetCount()));
wxPostEvent(m_Parent, evt);
}
return NULL;
}
private:
CodeCompletion* m_Parent;
SystemHeadersMap& m_SystemHeadersMap;
wxArrayString m_IncludeDirs;
private:
class HeaderDirTraverser : public wxDirTraverser
{
public:
HeaderDirTraverser(SystemHeadersMap& headersMap, const wxString& searchDir) :
m_SystemHeadersMap(headersMap),
m_SearchDir(searchDir),
m_Headers(headersMap[searchDir]),
m_Locker(NULL),
m_HeaderCount(0)
{}
~HeaderDirTraverser()
{
if (m_Locker)
delete m_Locker;
}
virtual wxDirTraverseResult OnFile(const wxString& filename)
{
if (!AddLock())
return wxDIR_STOP;
wxFileName fn(filename);
if (!fn.HasExt() || fn.GetExt().GetChar(0) == _T('h'))
{
fn.MakeRelativeTo(m_SearchDir);
wxString final(fn.GetFullPath());
final.Replace(_T("\\"), _T("/"), true);
m_Headers.push_back(final);
}
return wxDIR_CONTINUE;
}
virtual wxDirTraverseResult OnDir(const wxString& dirname)
{
if (!AddLock())
return wxDIR_STOP;
wxString path(dirname);
if (path.Last() != wxFILE_SEP_PATH)
path.Append(wxFILE_SEP_PATH);
if (m_SystemHeadersMap.find(path) != m_SystemHeadersMap.end())
return wxDIR_IGNORE;
return wxDIR_CONTINUE;
}
bool AddLock()
{
if (++m_HeaderCount % 100 == 1)
{
if (m_Locker)
{
delete m_Locker;
m_Locker = NULL;
}
wxMilliSleep(1);
m_Locker = new(std::nothrow) wxCriticalSectionLocker(s_HeadersCriticalSection);
}
return !!m_Locker;
}
private:
const SystemHeadersMap& m_SystemHeadersMap;
const wxString& m_SearchDir;
std::list<wxString>& m_Headers;
wxCriticalSectionLocker* m_Locker;
size_t m_HeaderCount;
};
};
ibpp(http://www.ibpp.org/ (http://www.ibpp.org/)) and CC problem still not solved
http://forums.next.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492 (http://forums.next.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492)
Quote from: Loaden on September 24, 2010, 08:48:21 AM
It's very simply. :?
You mean simple?
In this case != NULL is best (in fact you could use != nullptr in C::B), because you're documenting that this is a check for NULL.
"!!" is very confusing for people not seen this before...
Also why do you create the locker on the heap, probably some commenting will be good, this is way to non trivial code you've written.
Quote from: oBFusCATed on September 24, 2010, 09:03:29 AM
Also why do you create the locker on the heap, probably some commenting will be good, this is way to non trivial code you've written.
Because we need to give the main thread of a chance to enter the critical.
You can check this code:
// Do the code completion when we enter:
// #include "| or #include <|
void CodeCompletion::CodeCompleteIncludes()
{
...
// #include <|
if (m_CCSystemHeaderFiles)
{
wxCriticalSectionLocker locker(s_HeadersCriticalSection);
wxArrayString& incDirs = GetSystemIncludeDirs(&m_NativeParser.GetParser(),
project ? project->GetModified() : true);
for (size_t i = 0; i < incDirs.GetCount(); ++i)
{
SystemHeadersMap::iterator it = m_SystemHeadersMap.find(incDirs[i]);
if (it != m_SystemHeadersMap.end())
{
const std::list<wxString>& headers = it->second;
for (std::list<wxString>::const_iterator it = headers.begin(); it != headers.end(); ++it)
files.insert(*it);
}
}
}
This will make the UI more responsive.
Quote from: oBFusCATed on September 24, 2010, 09:03:29 AM
In this case != NULL is best (in fact you could use != nullptr in C::B), because you're documenting that this is a check for NULL.
"!!" is very confusing for people not seen this before...
Got it! Thanks!!
QuoteIndex: src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- src/plugins/codecompletion/codecompletion.cpp (revision 6632)
+++ src/plugins/codecompletion/codecompletion.cpp (working copy)
@@ -339,7 +339,7 @@
m_Locker = new(std::nothrow) wxCriticalSectionLocker(s_HeadersCriticalSection);
}
- return !!m_Locker;
+ return m_Locker != NULL;
}
private:
Quote from: Borr on September 24, 2010, 09:00:21 AM
ibpp(http://www.ibpp.org/ (http://www.ibpp.org/)) and CC problem still not solved
http://forums.next.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492 (http://forums.next.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492)
Template inheritance is not yet supported.
Loaden:
Why don't you use message passing for this?
What you've done is just a hack...
Also, It seems that the list of files won't be correct if the main thread enters the critical section before the worker have finished.
Probably it will be better to add an item in the list -> "Processing 10%"
well :
return m_Locker != 0;
NULL : :-( , please C++0X come fast (or at least gcc implement it fast) nullptr.
Quote from: oBFusCATed on September 24, 2010, 09:34:17 AM
Also, It seems that the list of files won't be correct if the main thread enters the critical section before the worker have finished.
I think it does not matter, because the probability is too small.
Even if other implementations, can not be perfect!
Quote from: oBFusCATed on September 24, 2010, 09:34:17 AM
Probably it will be better to add an item in the list -> "Processing 10%"
I think it is not necessary.
Quote from: killerbot on September 24, 2010, 09:37:25 AM
well :
return m_Locker != 0;
NULL : :-( , please C++0X come fast (or at least gcc implement it fast) nullptr.
It is easy replace all from "NULL" to "nullptr", but it is diffcult replace all from "0" to "nullptr".
I knew this argument would be brought up ;-)
As far as I know nullptr is defined somewhere in CB's sources, so it could be used.
p.s. nullptr will be in gcc 4.6 :)
Add new feature for remove all bookmarks
Quote from: Borr on September 24, 2010, 09:00:21 AM
ibpp(http://www.ibpp.org/ (http://www.ibpp.org/)) and CC problem still not solved
http://forums.next.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492 (http://forums.next.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492)
Operator overload for "->" is added at least for some std containers.
Quote from: oBFusCATed on September 24, 2010, 10:31:04 AM
As far as I know nullptr is defined somewhere in CB's sources, so it could be used.
p.s. nullptr will be in gcc 4.6 :)
Rewritten nullptr.
docs: http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/nullptr (http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/nullptr)
Rewritten nullptr again.
#if ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) ) \
&& !defined __GXX_EXPERIMENTAL_CXX0X__
const class nullptr_t
{
public:
template<typename T> operator T* () const { return (T*)0; }
template<typename C, typename T> operator T C::* () const { return (T C::*)0; }
template<typename T> bool equals(T const& rhs) const { return rhs == 0; }
private:
void operator&() const;
} nullptr = {};
template<typename T> inline bool operator==(const nullptr_t& lhs, T const& rhs) { return lhs.equals(rhs); }
template<typename T> inline bool operator==(T const& lhs, const nullptr_t& rhs) { return rhs.equals(lhs); }
template<typename T> inline bool operator!=(const nullptr_t& lhs, T const& rhs) { return !lhs.equals(rhs); }
template<typename T> inline bool operator!=(T const& lhs, const nullptr_t& rhs) { return !rhs.equals(lhs); }
#endif
class A {};
int main()
{
int* p = nullptr;
if (p == nullptr || p != nullptr)
;
if (nullptr == p || nullptr != p)
;
A* a = nullptr;
if (a == nullptr || a != nullptr)
;
if (nullptr == a || nullptr != a)
;
return 0;
}
:lol:
[attachment deleted by admin]
Loaden you can't implement nullptr using c++98 or c++03, if should be added to the language!
Quote from: oBFusCATed on September 24, 2010, 04:23:43 PM
Loaden you can't implement nullptr using c++98 or c++03, if should be added to the language!
I know, However, Before added to the language, we can first use it to replace, in order to C++0x.
:)
Quote from: Loaden on September 24, 2010, 04:35:05 PM
Quote from: oBFusCATed on September 24, 2010, 04:23:43 PM
Loaden you can't implement nullptr using c++98 or c++03, if should be added to the language!
I know, However, Before added to the language, we can first use it to replace, in order to C++0x.
:)
Quote#if ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) ) \
&& !defined __GXX_EXPERIMENTAL_CXX0X__
const class nullptr_t
{
I put nullptr_t in guard, that meaning: we can use nullptr if the nullptr is not added to the language. (GCC >= 4.6 && -std=c++0x)
If the nullptr has added to the language, we can not use this nullptr class any more.
V3
test demo:
#if ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) ) \
&& !defined __GXX_EXPERIMENTAL_CXX0X__
// it is a const object...
const class nullptr_t
{
public:
// constructor
nullptr_t() {}
// convertible to any type of null non-member pointer...
template<typename T> operator T* () const{ return (T*)0; }
// or any type of null member pointer...
template<typename C, typename T> operator T C::* () const { return (T C::*)0; }
// support operator overloading (== and !=)
template<typename T> bool equals(T const& rhs) const { return rhs == 0; }
private:
// can't take address of nullptr
void operator&() const;
// can't copyable
nullptr_t(const nullptr_t&);
const nullptr_t& operator=(const nullptr_t&);
} nullptr;
template<typename T> inline bool operator==(const nullptr_t& lhs, T const& rhs) { return lhs.equals(rhs); }
template<typename T> inline bool operator==(T const& lhs, const nullptr_t& rhs) { return rhs.equals(lhs); }
template<typename T> inline bool operator!=(const nullptr_t& lhs, T const& rhs) { return !lhs.equals(rhs); }
template<typename T> inline bool operator!=(T const& lhs, const nullptr_t& rhs) { return !rhs.equals(lhs); }
#endif
class A {};
int main()
{
nullptr_t* n2;
n2 = nullptr;
int* p = nullptr;
if (p == nullptr || p != nullptr)
;
if (nullptr == p || nullptr != p)
;
A* a = nullptr;
if (a == nullptr || a != nullptr)
;
if (nullptr == a || nullptr != a)
;
return 0;
}
Quote from: blueshake on September 22, 2010, 04:59:56 PM
support member variable initialation codecompletion now
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
nice to visit the forum again.
here is the patch.
new nightlies (well the one from Saturday, coming this evening), you can find them already at berlios, but now that the forum is back they can be posted ....
Not sure if we really need this. We've had a nullptr implementation since 2007 (I wrote that one before being aware of Meyer's more elegant solution), and nobody ever cared to use nullptr anywhere in the code :P
Quote from: thomas on September 27, 2010, 05:09:24 PM
Not sure if we really need this. We've had a nullptr implementation since 2007 (I wrote that one before being aware of Meyer's more elegant solution), and nobody ever cared to use nullptr anywhere in the code :P
This seems more like we do not know there is a nullptr implement in CB's sdk.
Use nullptr instead of 0 (or NULL) is sooner or later.
I like the C++0x. :)
Quote from: blueshake on September 27, 2010, 02:21:47 PM
Quote from: blueshake on September 22, 2010, 04:59:56 PM
support member variable initialation codecompletion now
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
nice to visit the forum again.
here is the patch.
Nice! The patch improved code completion in member variable init position.
Now it will works better.
a.h
namespace A{
class myclass{
public:
void myfunc();
}
}
a.cpp
using namespace A;
void myclass::myfunc(){
//codes here
}
where i right clicked "void myfunc()" in file "a.h" and choose "find implemetion of myfunc()", but failed with "not found myfunc()"
i know it's because of namespace, if i add namespace like this: A::myclass::myfunc(), it's fine
Quote from: huliming2004 on October 01, 2010, 11:59:14 PM
a.h
namespace A{
class myclass{
public:
void myfunc();
}
}
a.cpp
using namespace A;
void myclass::myfunc(){
//codes here
}
where i right clicked "void myfunc()" in file "a.h" and choose "find implemetion of myfunc()", but failed with "not found myfunc()"
i know it's because of namespace, if i add namespace like this: A::myclass::myfunc(), it's fine
confirmed!
And this code could be parse well.
a.cpp
namespace A
{
void myclass::myfunc(){
//codes here
}
}
Quote from: Loaden on October 02, 2010, 03:11:58 AM
a.cpp
namespace A
{
void myclass::myfunc(){
//codes here
}
}
Yes, I prefer using this way, and CC works fine.
and Currently CC does not handling "using namespace XXX " directive correctly.
thanks :D i changed my project codes and now it works fine
I succeed in retrieving and compiling trunk, but I would like to use his branch.
How could I retrieve this branch using svn ? I have tried svn checkout svn://svn.berlios.de/svnroot/repos/codeblocks/branches/codecompletion_refactoring, but it doesn't work...
Quote from: Folco on October 06, 2010, 02:30:17 PM
I succeed in retrieving and compiling trunk, but I would like to use his branch.
How could I retrieve this branch using svn ? I have tried dvn checkout svn://svn.berlios.de/svnroot/repos/codeblocks/branches/codecompletion_refactoring, but it doesn't work...
Hi,
try this:
svn co svn://svn.berlios.de/codeblocks/branches/codecompletion_refactoring codeblocks_cc_branch
Thanks ! it's compiling. 8)