Are there any upper limits for CC (parsing ?) related to :
- number of projects in workspace
There is a limit for project numbers if you are in "One Parser per Project" case. I don't think there is a limit for the "One Parser for the whole Workspace" case.
- number of files
- number of tokens identified
No.
@Morten
I see a comment by you in the source code:
void NativeParser::OnParsingOneByOneTimer(cb_unused wxTimerEvent& event)
{
TRACE(_T("NativeParser::OnParsingOneByOneTimer(): Enter"));
std::pair<cbProject*, ParserBase*> info = GetParserInfoByCurrentEditor();
if (m_ParserPerWorkspace)
{
// If there is no parser and an active editor file can be obtained, parse the file according the active project
if (!info.second && Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor())
{
// NOTE (Morten#1#): Shouldn't this actually be a temp parser??? I think this screws things with re-opening files on load of a projects...
AddProjectToParser(info.first);
CCLogger::Get()->DebugLog(_T("NativeParser::OnParsingOneByOneTimer(): Add foreign active editor to current active project's parser."));
}
// Otherwise, there is a parser already present
else
{
// First: try to parse the active project (if any)
cbProject* activeProject = Manager::Get()->GetProjectManager()->GetActiveProject();
if (m_ParsedProjects.find(activeProject) == m_ParsedProjects.end())
{
AddProjectToParser(activeProject);
CCLogger::Get()->DebugLog(_T("NativeParser::OnParsingOneByOneTimer(): Add new (un-parsed) active project to parser."));
}
// Else: add remaining projects one-by-one (if any)
else
{
ProjectsArray* projs = Manager::Get()->GetProjectManager()->GetProjects();
for (size_t i = 0; i < projs->GetCount(); ++i)
{
// Only add, if the project is not already parsed
if (m_ParsedProjects.find(projs->Item(i)) == m_ParsedProjects.end())
{
AddProjectToParser(projs->Item(i));
CCLogger::Get()->DebugLog(_T("NativeParser::OnParsingOneByOneTimer(): Add additional (next) project to parser."));
break;
}
}
}
}
}
else if (info.first && !info.second)
{
info.second = CreateParser(info.first);
if (info.second && info.second != m_Parser)
{
CCLogger::Get()->DebugLog(_T("NativeParser::OnParsingOneByOneTimer(): Start switch from OnParsingOneByOneTimer"));
SwitchParser(info.first, info.second); // Calls SetParser() which also calls UpdateClassBrowserView()
}
}
TRACE(_T("NativeParser::OnParsingOneByOneTimer(): Leave"));
}
Here
// NOTE (Morten#1#): Shouldn't this actually be a temp parser??? I think this screws things with re-opening files on load of a projects...
I agree on this, why do we need to check the editor on the OnParsingOneByOneTimer event? This is basically to parse the project sequentially in one parser for whole workspace mode.
new test : I create a "DUMMY" project, which cpp file was including the headers that the "FOO" library has, meaning every file of project "FOO" (remember header only) CAN/HAS been seen by the parser.
When DUMMY is after FOO : all ok.
When DUMMY is before FOO, the above mentioned problem pops up, and all parsing stops, the OnParserEnd for "FOO" never happens.
NativeParser::AddProjectToParser(): Add project (Dummy) to parser
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (FOO) to parser
The errors appears on my system.
Here are the logs if "a" is the active project:
"Code::Blocks"-tab
Opening /home/jens/Downloads/test/a.cbp
Fertig.
Opening /home/jens/Downloads/test/b.cbp
Fertig.
Opening /home/jens/Downloads/test/c.cbp
Fertig.
NativeParser::CreateParser(): Finish creating a new parser for project 'a'
NativeParser::OnParserEnd(): Project 'a' parsing stage done!
NativeParser::AddProjectToParser(): Add project (b) to parser
"Code::Blocks Debug"-tab
Loading workspace "/home/jens/Downloads/test/abc.workspace"
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
4 files loaded
Done loading project in 1ms
Project's base path: /home/jens/Downloads/test/
Project's common toplevel path: /home/jens/Downloads/test/
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
2 files loaded
Done loading project in 1ms
Project's base path: /home/jens/Downloads/test/
Project's common toplevel path: /home/jens/Downloads/test/
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
2 files loaded
Done loading project in 1ms
Project's base path: /home/jens/Downloads/test/
Project's common toplevel path: /home/jens/Downloads/test/
Workspace layout file doesn't exist "/home/jens/Downloads/test/abc.workspace.layout"
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.8.2
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.8.2/x86_64-redhat-linux
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.8.2/backward
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/local/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include
NativeParser::DoFullParsing(): AddCompilerPredefinedMacros failed!
NativeParser::DoFullParsing(): Adding three kind of files to batch-parser
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/c++/4.8.2/cstddef'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/config.hpp'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/filesystem/config.hpp'
NativeParser::DoFullParsing(): Add 3 priority file(s) for project 'a'...
NativeParser::DoFullParsing(): Added 4 header&source file(s) for project 'a' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'a'
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::OnParserStart(): Starting batch parsing for project 'a'...
NativeParser::OnParserEnd(): Project 'a' parsing stage done!
Project 'a' parsing stage done (19 total parsed files, 478 tokens in 0 minute(s), 0.047 seconds).
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
SystemHeadersThread: /usr/include/c++/4.8.2/ , 602
SystemHeadersThread: /usr/include/c++/4.8.2/x86_64-redhat-linux/ , 46
SystemHeadersThread: /usr/include/c++/4.8.2/backward/ , 8
SystemHeadersThread: /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/ , 52
SystemHeadersThread: /usr/local/include/ , 0
SystemHeadersThread: /usr/include/ , 16270
SystemHeadersThread: Total number of paths: 6
NativeParser::AddProjectToParser(): Add project (b) to parser
NativeParser::AddProjectToParser(): AddCompilerPredefinedMacros failed!
NativeParser::AddProjectToParser(): Done adding 0 files of project (b) to parser.
NativeParser::OnParsingOneByOneTimer(): Add additional (next) project to parser.
Saving workspace layout "/home/jens/Downloads/test/abc.workspace.layout"
and with "b" as active project:
"Code::Blocks"-tab
Opening /home/jens/Downloads/test/a.cbp
Fertig.
Opening /home/jens/Downloads/test/b.cbp
Fertig.
Opening /home/jens/Downloads/test/c.cbp
Fertig.
NativeParser::CreateParser(): Finish creating a new parser for project 'b'
NativeParser::OnParserEnd(): Project 'b' parsing stage done!
NativeParser::AddProjectToParser(): Add project (a) to parser
NativeParser::OnParserEnd(): Project 'a' parsing stage done!
NativeParser::AddProjectToParser(): Add project (c) to parser
NativeParser::OnParserEnd(): Project 'c' parsing stage done!
"Code::Blocks Debug"-tab
Loading workspace "/home/jens/Downloads/test/abc.workspace"
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
4 files loaded
Done loading project in 1ms
Project's base path: /home/jens/Downloads/test/
Project's common toplevel path: /home/jens/Downloads/test/
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
2 files loaded
Done loading project in 1ms
Project's base path: /home/jens/Downloads/test/
Project's common toplevel path: /home/jens/Downloads/test/
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
2 files loaded
Done loading project in 1ms
Project's base path: /home/jens/Downloads/test/
Project's common toplevel path: /home/jens/Downloads/test/
Loading workspace layout "/home/jens/Downloads/test/abc.workspace.layout"
Project /home/jens/Downloads/test/b.cbp has been activated.
NativeParser::DoFullParsing(): AddCompilerPredefinedMacros failed!
NativeParser::DoFullParsing(): Adding three kind of files to batch-parser
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/c++/4.8.2/cstddef'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/config.hpp'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/filesystem/config.hpp'
NativeParser::DoFullParsing(): Add 3 priority file(s) for project 'b'...
NativeParser::DoFullParsing(): Added 2 header&source file(s) for project 'b' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'b'
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::OnParserStart(): Starting batch parsing for project 'b'...
NativeParser::OnParserEnd(): Project 'b' parsing stage done!
Project 'b' parsing stage done (17 total parsed files, 476 tokens in 0 minute(s), 0.046 seconds).
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::AddProjectToParser(): Add project (a) to parser
NativeParser::AddProjectToParser(): AddCompilerPredefinedMacros failed!
NativeParser::AddProjectToParser(): Done adding 2 files of project (a) to parser.
NativeParser::OnParsingOneByOneTimer(): Add additional (next) project to parser.
NativeParser::OnParserStart(): Starting batch parsing for project 'a'...
NativeParser::OnParserEnd(): Project 'a' parsing stage done!
Project 'a' parsing stage done (19 total parsed files, 478 tokens in 0 minute(s), 0.011 seconds).
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::AddProjectToParser(): Add project (c) to parser
NativeParser::AddProjectToParser(): AddCompilerPredefinedMacros failed!
NativeParser::AddProjectToParser(): Done adding 2 files of project (c) to parser.
NativeParser::OnParsingOneByOneTimer(): Add additional (next) project to parser.
NativeParser::OnParserStart(): Starting batch parsing for project 'c'...
NativeParser::OnParserEnd(): Project 'c' parsing stage done!
Project 'c' parsing stage done (21 total parsed files, 480 tokens in 0 minute(s), 0.012 seconds).
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
Attached archive, contains a workspace containing 3 projects :
- Dummy
- NamingService (the header only, nearly no more code in it, and where parsing stops upon)
- Dummy2
Here's the log :
Opening /home/killerbot/Projects/CC-bug/libraries/common/Dummy/Project/Dummy.cbp
Done.
Opening /home/killerbot/Projects/CC-bug/libraries/common/NamingService/Project/NamingService.cbp
Done.
Opening /home/killerbot/Projects/CC-bug/libraries/common/Dummy2/Project/Dummy2.cbp
Done.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
tried in on my win virtual box (winxp) :
Opening C:\Projects\cc-bug\libraries\common\Dummy\Project\Dummy.cbp
Done.
Opening C:\Projects\cc-bug\libraries\common\NamingService\Project\NamingService.cbp
Done.
Opening C:\Projects\cc-bug\libraries\common\Dummy2\Project\Dummy2.cbp
Done.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParserEnd(): Project 'NamingService' parsing stage done!
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
So seems it is a linux only issue.
tried in on my win virtual box (winxp) :
Opening C:\Projects\cc-bug\libraries\common\Dummy\Project\Dummy.cbp
Done.
Opening C:\Projects\cc-bug\libraries\common\NamingService\Project\NamingService.cbp
Done.
Opening C:\Projects\cc-bug\libraries\common\Dummy2\Project\Dummy2.cbp
Done.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParserEnd(): Project 'NamingService' parsing stage done!
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
So seems it is a linux only issue.
This is quite strange. Can you try the CC patch below to see whether it works OK under Linux? Thanks.
c423a5611f77ecc95925e3fb7d75042cbcbfb83b
src/plugins/codecompletion/nativeparser.cpp | 23 +++++++++++++++++------
src/plugins/codecompletion/nativeparser.h | 4 ++--
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/plugins/codecompletion/nativeparser.cpp b/src/plugins/codecompletion/nativeparser.cpp
index c3d659e..cded451 100644
--- a/src/plugins/codecompletion/nativeparser.cpp
+++ b/src/plugins/codecompletion/nativeparser.cpp
@@ -2643,12 +2643,18 @@ void NativeParser::OnParsingOneByOneTimer(cb_unused wxTimerEvent& event)
else
{
ProjectsArray* projs = Manager::Get()->GetProjectManager()->GetProjects();
+ // loop on the whole workspace, and only add a new project to the parser
+ // here the "new" means a project haven't been parsed. Once it was parsed, it is
+ // added to the m_ParsedProjects
for (size_t i = 0; i < projs->GetCount(); ++i)
{
// Only add, if the project is not already parsed
if (m_ParsedProjects.find(projs->Item(i)) == m_ParsedProjects.end())
{
- AddProjectToParser(projs->Item(i));
+ // if total files of current project were already parsed, we should try the next project
+ int actualAddFileNumber = AddProjectToParser(projs->Item(i));
+ if (!actualAddFileNumber)
+ continue;
CCLogger::Get()->DebugLog(_T("NativeParser::OnParsingOneByOneTimer(): Add additional (next) project to parser."));
break;
}
@@ -2763,24 +2769,24 @@ void NativeParser::InitCCSearchVariables()
Reset();
}
-void NativeParser::AddProjectToParser(cbProject* project)
+int NativeParser::AddProjectToParser(cbProject* project)
{
wxString prj = (project ? project->GetTitle() : _T("*NONE*"));
ParserBase* parser = GetParserByProject(project);
if (parser)
- return;
+ return 0;
if (m_ParsedProjects.empty())
- return;
+ return 0;
m_ParsedProjects.insert(project);
parser = GetParserByProject(project);
if (!parser)
- return;
+ return 0;
else if (!parser->UpdateParsingProject(project))
{
m_ParsedProjects.erase(project);
- return;
+ return 0;
}
// TODO (ollydbg#1#) did exactly the same thing as the function NativeParser::DoFullParsing()?
@@ -2820,6 +2826,9 @@ void NativeParser::AddProjectToParser(cbProject* project)
}
CCLogger::Get()->DebugLog(F(_("NativeParser::AddProjectToParser(): Done adding %lu files of project (%s) to parser."), static_cast<unsigned long>(fileCount), prj.wx_str()));
+
+ // in some cases, all the files were already be parsed, so fileCount is still 0
+ return fileCount;
}
else
{
@@ -2831,8 +2840,10 @@ void NativeParser::AddProjectToParser(cbProject* project)
m_StandaloneFiles.Add(editor->GetFilename());
CCLogger::Get()->DebugLog(F(_("NativeParser::AddProjectToParser(): Done adding stand-alone file (%s) of editor to parser."), editor->GetFilename().wx_str()));
+ return 1;
}
}
+ return 0;
}
bool NativeParser::RemoveProjectFromParser(cbProject* project)
diff --git a/src/plugins/codecompletion/nativeparser.h b/src/plugins/codecompletion/nativeparser.h
index 333166e..48b65a4 100644
--- a/src/plugins/codecompletion/nativeparser.h
+++ b/src/plugins/codecompletion/nativeparser.h
@@ -416,8 +416,8 @@ private:
/** Init cc search member variables */
void InitCCSearchVariables();
- /** Add all project files to parser */
- void AddProjectToParser(cbProject* project);
+ /** Add all project's files to parser */
+ int AddProjectToParser(cbProject* project);
/** Remove cbp from the common parser, this only happens in one parser for whole workspace mode
* when a parser is removed from the workspace, we should remove the project from the parser
The description of the patch is:
* CC: Fix a bug in the one parser for the whole workspace mode, if a project's file was already parsed by previous projects, then this project don't actually run a parsing tasks (for parsing source files), thus there is not ParserEnd event happened.
The general logic are below:
thread pool done-> send event to Parser object
Parser::OnAllThreadsDone(CodeBlocksEvent& event) -> send a Parser End event
NativeParser::OnParserEnd -> m_TimerParsingOneByOne.Start(500, wxTIMER_ONE_SHOT);
NativeParser::OnParsingOneByOneTimer -> AddProjectToParser(projs->Item(i)); (adding the next project)
But if AddProjectToParser() add nothing to the Task pool, there will be no "thread pool done" again, so all the remaining projects has no chance to be done.
So, I simply let the AddProjectToParser() function return actually added file numbers, if it is zero, we try to parse the next project.
This seems to work.
Opening /home/killerbot/Projects/CC-bug/libraries/common/Dummy/Project/Dummy.cbp
Done.
Opening /home/killerbot/Projects/CC-bug/libraries/common/NamingService/Project/NamingService.cbp
Done.
Opening /home/killerbot/Projects/CC-bug/libraries/common/Dummy2/Project/Dummy2.cbp
Done.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
also the big workspace I had completed till the end.
Note : OnParserEnd() is printed for these header only projects, and the same for a project which is based upon a makefile. But stuff continued till the end, the projects I had which are based on makefile are at the end, but all of them passed by, so I guess these are also ok.
indeed : "NOT" printed, sorry for the confusion.
Commit welcome.
I try to find the reason why this is a Linux only bug, with the new patch, I would like to see what's the log of your test workspace.
This is mine on Windows.
Opening E:\cc-bug\libraries\common\Dummy\Project\Dummy.cbp
Done.
Opening E:\cc-bug\libraries\common\NamingService\Project\NamingService.cbp
Done.
Opening E:\cc-bug\libraries\common\Dummy2\Project\Dummy2.cbp
Done.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParsingOneByOneTimer(): all files in this project were already parsed, try next project.
NativeParser::OnParsingOneByOneTimer(): all files in this project were already parsed, try next project.
NativeParser::OnParserEnd(): Project 'NamingService' parsing stage done!
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
EDIT: patch deleted, because later posts contain new patches.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParsingOneByOneTimer(): all files in this project were already parsed, try next project.
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParsingOneByOneTimer(): all files in this project were already parsed, try next project.
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
Thanks, now, I need to understand why in Windows, there is two message:
NativeParser::OnParsingOneByOneTimer(): all files in this project were already parsed, try next project.
But it only has one on Linux.
I debugged the code a little, found that my patch was not quite logically OK. By testing your sample workspace, I noticed that the second cbp add no source files, but I see it did add some macro definitions (from the GCC -E ... command), so adding the third project in that loop(see my patch) is not a good idea, because it will cause the third cbp added, and removed again, then added again....
if ( !m_PriorityHeaders.empty()
|| !m_BatchParseFiles.empty()
|| !m_PredefinedMacros.IsEmpty() )
{
CC_LOCKER_TRACK_P_MTX_LOCK(ParserCommon::s_ParserMutex)
ParserThreadedTask* thread = new ParserThreadedTask(this, ParserCommon::s_ParserMutex);
TRACE(_T("Parser::OnBatchTimer(): Adding a ParserThreadedTask thread to m_Pool."));
m_Pool.AddTask(thread, true); //once this function is called, the thread will be executed from the pool.
If m_PredefinedMacros is not empty, there is still one ParserThreadedTask put in the m_Pool, that's the reason the bug doesn't happened under Windows(without my patch). So, there comes a guess, if under Linux, C::B svn code (without my patch), I guess that the cbp is not a standard project(such as a makefile project) Or in some wired reason ???, then m_PredefinedMacros is empty, so no thread task will be put in the pool, so the bug happens because the m_Pool have not tasks to run.
...if under Linux, C::B svn code (without my patch), I guess that the cbp is not a standard project(such as a makefile project) Or in some wired reason ???, then m_PredefinedMacros is empty, so no thread task will be put in the pool, so the bug happens because the m_Pool have not tasks to run.
Ok, my guess is right, refer to Jen's reply (http://forums.codeblocks.org/index.php/topic,18836.msg129218.html#msg129218)
In the first test case, I did see in the debug log:
...
NativeParser::DoFullParsing(): AddCompilerPredefinedMacros failed!
...
NativeParser::AddProjectToParser(): AddCompilerPredefinedMacros failed!
NativeParser::AddProjectToParser(): Done adding 0 files of project (b) to parser.
Look at the log, when parsing project(a), the variable m_PredefinedMacros is empty, but m_BatchParseFiles is not empty, m_PriorityHeaders is not empty.
But when parsing project(b), I see that m_PredefinedMacros and m_BatchParseFiles are both empty. I don't know m_PriorityHeaders, I think it is also empty. So, that's the bug, every thing is empty, so the m_Pool is free now.
Compare to my test under Windows, debug log, I think the m_PredefinedMacros is not empty (I don't receive "NativeParser::AddProjectToParser()/DoFullParsing(): AddCompilerPredefinedMacros failed!" error message) when parsing the second project, so at least on thread task is put in the m_Pool.
Now, one question: why fetch compilerPredefinedMacros get failed in Linux?
This is the new patch, I think the bug is correctly fixed.
Please apply the patch, and give the logs.
Under Windows, I can correctly get the compiler predefined macros, so I get the following log (after applying the patch)
Opening E:\cc-bug\libraries\common\Dummy\Project\Dummy.cbp
Done.
Opening E:\cc-bug\libraries\common\NamingService\Project\NamingService.cbp
Done.
Opening E:\cc-bug\libraries\common\Dummy2\Project\Dummy2.cbp
Done.
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParserEnd(): Project 'NamingService' parsing stage done!
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
I guess under Linux (you failed to fetch the compiler predefined macros), so you should get something like:
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParsingOneByOneTimer(): nothing need to parse in this project, try next project.
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!
Thanks.
EDIT: patch deleted, because later posts contain new patches.
result of testing the new patch :
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
So it seems it doesn't work anymore
this is from the debug log (had to start CB with option -d to have that log) :
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.7
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.7/x86_64-suse-linux
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include/c++/4.7/backward
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib64/gcc/x86_64-suse-linux/4.7/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/local/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/lib64/gcc/x86_64-suse-linux/4.7/include-fixed
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/x86_64-suse-linux/include
NativeParser::GetGCCCompilerDirs(): Caching GCC default include dir: /usr/include
NativeParser::DoFullParsing(): AddCompilerPredefinedMacros failed!
NativeParser::DoFullParsing(): Adding three kind of files to batch-parser
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/c++/4.7/cstddef'
NativeParser::DoFullParsing(): Add priority header file: '/home/killerbot/Projects/newtec/duck/trunk/toolchain/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/include/c++/4.7.0/cstddef'
NativeParser::DoFullParsing(): Add priority header file: '/usr/local/include/c++/v1/cstddef'
NativeParser::DoFullParsing(): Add priority header file: '/usr/local/include/boost/config.hpp'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/config.hpp'
NativeParser::DoFullParsing(): Add priority header file: '/usr/local/include/boost/filesystem/config.hpp'
NativeParser::DoFullParsing(): Add priority header file: '/usr/include/boost/filesystem/config.hpp'
NativeParser::DoFullParsing(): Add 7 priority file(s) for project 'Dummy'...
NativeParser::DoFullParsing(): Added 2 header&source file(s) for project 'Dummy' to batch-parser...
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::OnParserStart(): Starting batch parsing for project 'Dummy'...
ReadClsNames() : Unexpected token '((__aligned__))' for 'struct80___pthread_unwind_buf_t', file '/usr/include/pthread.h', line 515.
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
Project 'Dummy' parsing stage done (78 total parsed files, 2440 tokens in 0 minute(s), 0.955 seconds).
SystemHeadersThread: /home/killerbot/Projects/CC-bug/libraries/common/NamingService/export/ , 1
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::AddProjectToParser(): AddCompilerPredefinedMacros failed!
NativeParser::AddProjectToParser(): Done adding 0 files of project (NamingService) to parser.
NativeParser::OnParsingOneByOneTimer(): Add additional (next) project to parser.
so it doesn't do dummy2 anymore
tested new patch.
from the logs, it seems ok
NativeParser::CreateParser(): Finish creating a new parser for project 'Dummy'
NativeParser::OnParserEnd(): Project 'Dummy' parsing stage done!
NativeParser::AddProjectToParser(): Add project (NamingService) to parser
NativeParser::OnParsingOneByOneTimer(): nothing need to parse in this project, try next project.
NativeParser::AddProjectToParser(): Add project (Dummy2) to parser
NativeParser::OnParserEnd(): Project 'Dummy2' parsing stage done!