CC fails often, too often, but always hard to pinpoint/reproduce issues.
I think however I stumbled upon one.
CB was open with 1 project which had been parsed. Outside CB I created a new project and then dragged and dropped the cbp file into the Projects tab within CB ==> in the Code::Blocks log tab, no sign to be found that it would be parsed, guessing it was not parsed.
NativeParser::CreateParser(): Finish creating a new parser for project 'Asio4-Dns'
NativeParser::OnParserEnd(): Project 'Asio4-Dns' parsing stage done!
Opening /home/killerbot/Projects/Boost/Asio/Asio5-Buffers/Project/Asio5-Buffers.cbp //<===== just load, no parsing
Done.
Then I click right click on the project and choose "Reparse project" ==> again no parsing traces to be found in the CB log tab.
Then I closed the first project (in this case the Asio4) and then we see parsing happening on the Asio5. ==> new entries in the log :
NativeParser::DeleteParser(): Deleting parser for project 'Asio4-Dns'!
NativeParser::CreateParser(): Finish creating a new parser for project 'Asio5-Buffers'
NativeParser::OnParserEnd(): Project 'Asio5-Buffers' parsing stage done!
Note : clicking reparse project does show traces now in the log.
Extra info : Use one parser for the whole workspace
NOte : Concurrently parsing threads is on 1 (unable to change it, so what's the purpose ?)
Index: nativeparser.cpp
===================================================================
--- nativeparser.cpp (revision 9094)
+++ nativeparser.cpp (working copy)
@@ -558,13 +558,15 @@
return nullptr;
}
- // Easy case for "one parser per workspace" that has already been created:
+ // In the case of "one parser per workspace", the project is not include in the common parser
+ // we need to insert it, in other cases, a new Parser instance is needed
+ ParserBase* parser;
if (m_ParserPerWorkspace && !m_ParsedProjects.empty())
- return m_ParserList.begin()->second;
+ parser = m_ParserList.begin()->second; // reuse the common parser
+ else
+ parser = new Parser(this, project); // create a new Parser instance
TRACE(_T("NativeParser::CreateParser(): Calling DoFullParsing()"));
-
- ParserBase* parser = new Parser(this, project);
if ( !DoFullParsing(project, parser) )
{
CCLogger::Get()->DebugLog(_T("NativeParser::CreateParser(): Full parsing failed!"));
This patch should fix the problem reported by killerbot, please test and give some feedback.
The reason is: when you have a.cbp already opened, and in one_parser_for_whole_workspace mode, when you drag/drop another b.cbp, the CC did not run the "DoFullParsing" for the b.cbp but just return the common parser by "return m_ParserList.begin()->second;".