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);
}
}
parser->MarkFileTokensAsLocal(pf->file.GetFullPath(), true, project);
Under windows, there is a bug can't fixed yet. (this bug seems does not happened under linux)crash report like this:
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.
Error occured on Sunday, September 19, 2010 at 14:05:11.After call Addr2Line, here is more info:
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
******************************
* 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)
#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
@Loaden, I can not reproduce the crash, but face another bug:Thank you, I have found the reason and fixed soon!
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).
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
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???
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.
#include <iostream>
#include "console"
using namespace std;
using namespace console;
int main()
{
cout << "Hello!" ;
return 0;
}
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?
Sample code: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.
Sample code:Fixed, thanks!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.
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.
Thank you Loaden and all the guys who supported. Now this problem is fixed ;)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)
#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();
}
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 :SAre you aware that C::B compiles a single file with the compiler set as default compiler ?.
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.
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
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.
support member variable initialation codecompletion nowHi, blueshake, based you patch, I am fixed a bug.
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
void CodeRefactoring::Find(cbStyledTextCtrl* control, const wxString& file, const wxString& target)Please see the bold style code, why the return value always been zero.
{
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;
}
}
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.
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
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"
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
Revision: 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.codeblocks.org/index.php/topic,12351.0.html)
-------------------------------
M : /branches/codecompletion_refactoring/src/plugins/compilergcc/compilergcc.cpp
I can confirm this, and it works on debugger-branch and trunk.Hi, Jens, could you trying this patch?
@helpse:
the enable-auto-import option should be: -Wl,--enable-auto-import .
Fix system headers complete hangs.I see this in the patch:
@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)
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"
Thanks. After u fix this bug, please also post a compiled version.No !
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.
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! :(
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).
BTW:Re-upload again. Thanks!
the attachment file was wrong (file size =0K???) , you need to re-upload it again.
It just convert to bool.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?!
This is C-ish style of coding, not very appropriate for C++.I just like this convertion. It's very simply. :?
If you can use != 0, != NULL or something like that it is better.
What is the type of m_Locker?
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;
};
};
It's very simply. :?You mean simple?
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.
// 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);
}
}
}
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.Got it! Thanks!!
"!!" is very confusing for people not seen this before...
Index: 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:
ibpp(http://www.ibpp.org/ (http://www.ibpp.org/)) and CC problem still not solvedTemplate inheritance is not yet supported.
http://forums.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492 (http://forums.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492)
return m_Locker != 0;
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.
Probably it will be better to add an item in the list -> "Processing 10%"I think it is not necessary.
well :It is easy replace all from "NULL" to "nullptr", but it is diffcult replace all from "0" to "nullptr".Codereturn m_Locker != 0;
NULL : :-( , please C++0X come fast (or at least gcc implement it fast) nullptr.
ibpp(http://www.ibpp.org/ (http://www.ibpp.org/)) and CC problem still not solvedOperator overload for "->" is added at least for some std containers.
http://forums.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492 (http://forums.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492)
As far as I know nullptr is defined somewhere in CB's sources, so it could be used.Rewritten nullptr.
p.s. nullptr will be in gcc 4.6 :)
#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;
}
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.
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.
:)
#if ( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) ) \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)
&& !defined __GXX_EXPERIMENTAL_CXX0X__
const class nullptr_t
{
#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;
}
support member variable initialation codecompletion nownice to visit the forum again.
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
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 :PThis seems more like we do not know there is a nullptr implement in CB's sdk.
Nice! The patch improved code completion in member variable init position.support member variable initialation codecompletion nownice to visit the forum again.
(http://www.ikaca.sh.cn/attachment/201009/22/1745_1285167351sYYQ.png)
here is the patch.
a.hconfirmed!
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
a.cpp
namespace A
{
void myclass::myfunc(){
//codes here
}
}
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...
svn co svn://svn.berlios.de/codeblocks/branches/codecompletion_refactoring codeblocks_cc_branch