User forums > Nightly builds
The 16 January 2010 build (6088) is out.
sbezgodov:
--- Quote from: ollydbg on January 21, 2010, 02:25:43 am ---If you supply a simple test case, I will test for you. Thanks.
--- End quote ---
Just open hello world project or CB ContribPlugins workspace and you will see it when parsing is done. Look at attached images.
There is also TokenMatchesFilter() function in class browser, but seems that it was not changed in latest revisions. I think that token's m_IsLocal flag is not correctly set. What is the meaning of this flag? Seems it determines file is found in workspace or not.
[attachment deleted by admin]
Jenna:
--- Quote from: sbezgodov on January 21, 2010, 10:38:22 am ---
--- Quote from: ollydbg on January 21, 2010, 02:25:43 am ---If you supply a simple test case, I will test for you. Thanks.
--- End quote ---
Just open hello world project or CB ContribPlugins workspace and you will see it when parsing is done. Look at attached images.
--- End quote ---
Confirmed on linux.
This bug might be related to another issue, where the ide is unaccessible for some seconds on startup.
At least if the symbols-browser normally shows "All local symbols", and now shows "Everything" instead, because loading into the symbols-browser takes much longer and locks the IDE until it's finished.
ollydbg:
@jens and sbezgodov
I read some source code about the m_IsLocal.
--- Code: ---void ParserThread::HandleIncludes()
{
wxString filename;
bool isGlobal = !m_IsLocal;
wxString token = m_Tokenizer.GetToken();
// now token holds something like:
// "someheader.h"
// < and will follow iostream.h, >
if (TestDestroy())
return;
if (!token.IsEmpty())
{
if (token.GetChar(0) == '"')
{
// "someheader.h"
// don't use wxString::Replace(); it's too costly
size_t pos = 0;
while (pos < token.Length())
{
wxChar c = token.GetChar(pos);
if (c != _T('"'))
filename << c;
++pos;
}
}
else if (token.GetChar(0) == '<')
{
isGlobal = true;
// next token is filename, next is . (dot), next is extension
// basically we'll loop until >
while (1)
{
token = m_Tokenizer.GetToken();
if (token.IsEmpty())
break;
if (token.GetChar(0) != '>')
filename << token;
else
break;
}
}
}
if (!filename.IsEmpty())
{
TRACE(F(_T("HandleIncludes() : Found include file '%s'"), filename.wx_str()));
do
{
// setting all #includes as global
// it's amazing how many projects use #include "..." for global headers (MSVC mainly - booh)
isGlobal = true;
if (!(isGlobal ? m_Options.followGlobalIncludes : m_Options.followLocalIncludes))
break; // Nothing to do!
wxString real_filename = m_pParent->GetFullFileName(m_Filename, filename, isGlobal);
// Parser::GetFullFileName is thread-safe :)
if (real_filename.IsEmpty())
break; // File not found, do nothing.
{
wxCriticalSectionLocker lock(s_MutexProtection);
if (m_pTokensTree->IsFileParsed(real_filename))
break; // Already being parsed elsewhere
}
TRACE(F(_T("HandleIncludes() : Adding include file '%s'"), real_filename.wx_str()));
// since we 'll be calling directly the parser's method, let's make it thread-safe
{
wxCriticalSectionLocker lock2(s_mutexListProtection);
m_pParent->DoParseFile(real_filename, isGlobal);
}
} while (false);
}
}
--- End code ---
So, most Tokens in header files should be global (not local), only files belong to the workspace is local. Is there something wrong in handling include files?...
MortenMacFly:
--- Quote from: ollydbg on January 21, 2010, 04:00:09 pm ---
--- Code: --- // setting all #includes as global
// it's amazing how many projects use #include "..." for global headers (MSVC mainly - booh)
isGlobal = true;
--- End code ---
--- End quote ---
That makes it quite clear: We set all files to global as usually there is no strict usage of <> and "". So if we are strict users (of MSVC) will complain.
Jenna:
I think I found the cause for the local workspace bug, this patch should correct it:
--- Code: ------ tmp/tmpVBbR0I-meld/parser.cpp
+++ home/jens/codeblocks-build/codeblocks.trunk/src/plugins/codecompletion/parser/parser.cpp
@@ -964,7 +964,7 @@
return;
LoaderBase* loader = 0; // defer loading until later
- Parse(filename, isGlobal, loader);
+ Parse(filename, !isGlobal, loader);
}
void Parser::StartStopWatch()
--- End code ---
The old line was:
--- Code: --- Parse(filename, flags == 0, loader); // isLocal = (flags==0)
--- End code ---
@Morten:
please have a look.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version