Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
New code completion remarks/issues
ollydbg:
I find another issue in the current cc.
If you open the "plugins\debuggergdb\gdb_commands.h"
You will notice that in the CC's toolbar, only one function (wxStrHexTo) is listed. it seems the parser failed parsing this file. :(
I haven't found the reason....
ollydbg:
hi, all.
It seems the parser failed parsing this statement in the gdb_commands.h. (comment this statement can let the parser works ok :D)
--- Code: ---static wxRegEx rePendingBreakpoint(_T("Breakpoint ([0-9]+)[ \\t]\\(\\\"(.+):([0-9]+)\\)[ \\t]pending\\."));
--- End code ---
ollydbg:
--- Quote from: blueshake on October 02, 2009, 08:51:14 am ---May someboby notice that the cc suggestion list window style is different from the notepad++ whose window
stytle is something like pop menu.So if I want to change the cc suggestion list window style to make it similar with notepad++'s,what should I do?(change what codes, I read the codes,found nothing)
any comment? Thanks!
--- End quote ---
I compare the suggestion list window style of notepad++ 5.4 and codeblocks trunk. They are nearly the same. :D
Can you supply a screenshot that their windows are different??
ollydbg:
--- Quote from: ollydbg on October 03, 2009, 10:18:08 am ---hi, all.
It seems the parser failed parsing this statement in the gdb_commands.h. (comment this statement can let the parser works ok :D)
--- Code: ---static wxRegEx rePendingBreakpoint(_T("Breakpoint ([0-9]+)[ \\t]\\(\\\"(.+):([0-9]+)\\)[ \\t]pending\\."));
--- End code ---
--- End quote ---
One catch: it seems the parser failed parsing statement below:
--- Code: ---char * aaa = "\\\"";
--- End code ---
ollydbg:
The problem is located in this function in Tokenizer.cpp
--- Code: ---bool Tokenizer::SkipToCharBreak()
{
if (PreviousChar() != '\\')
return true;
else
{
// check for "\\"
if ( ((m_TokenIndex - 2) >= 0)
&& ((m_TokenIndex - 2) <= m_BufferLen)
&& (m_Buffer.GetChar(m_TokenIndex - 2) == '\\') )
return true;
}
return false;
}
--- End code ---
The main task of this function is try to check the current char is in a "C escape character".
For example, in the statement below:
--- Code: ---char * aaa = "\\\"";
--- End code ---
There are three quots in the statement above. the first quot and third quot is the start and the end of a C string definition. But the second quot is after a back slash \, is part of an escape character.
The parser starts the search from the first quot, and try to find the end of the C string. When it meets the second quot, This function try to check whether the second quot is the end of the C string.
But this function mistakenly regard the second quot as the end of the C string.
Also, this function checks several characters before the second quot, but that's not enough. In this statement
--- Code: ---"\\\""
--- End code ---
, the first two back slash
--- Code: ---\\
--- End code ---
is an escape character, and the third and forth
--- Code: ---\"
--- End code ---
groups another escape character.
So, how about parsing this statement?
--- Code: ---"\\\\\""
or
"\\\\\\\""
--- End code ---
I think we should left search from the second quot and count the back slash number until we meet the first non-back-slash char. and check the number is odd or even. :D
Any comments?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version