News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

The 16 January 2010 build (6088) is out.

Started by killerbot, January 17, 2010, 09:18:01 AM

Previous topic - Next topic

blueshake

Quote from: critic on January 19, 2010, 11:16:50 AM
I think this is strange behaviour of CC:

std::string().append("").append("").append(""). // and etc


The more recurces I use the slower CC works. Why? After last point in the example I waited about 15 seconds. And so on.
Can it be eliminated?


of course this will slow down the search process.you can see that 5 items will be searched.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

critic

But in Eclipse the same example works fine with 20 and over recursions. Is it's CC engine independent of recursions count?  :?

Jenna

Would it be possible to remember the last x search results if no reparsing has been done in the meantime and first search in the results-list (map or whatever is the best for this purpose) ?
After reparsing this list should be either cleared or updated.

MortenMacFly

Quote from: ollydbg on January 19, 2010, 07:35:47 AM
I find the bug why the parser get stuck when parsing the VC 2005 header files:
Well done.

Quote from: ollydbg on January 19, 2010, 07:35:47 AM
So, there is a logic error in handling typedef statement....
True.
You pointed correctly to:

void ParserThread::HandleTypedef(){
...
while(true)
{
       token = m_Tokenizer.GetToken();
       peek = m_Tokenizer.PeekToken();
......
       else if (peek == ParserConsts::comma)
       {
           m_Tokenizer.UngetToken();
           if (components.size() != 0)
           {
......
}

Just from a quick look I've added the other "bad" part. I'll look into it and try to reproduce.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

blueshake

@morten

you can try this patch:


Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- src/plugins/codecompletion/parser/parserthread.cpp (revision 6090)
+++ src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -1803,19 +1803,20 @@
         else if (peek == ParserConsts::comma)
         {
             m_Tokenizer.UngetToken();
+
             if (components.size() != 0)
             {
                 wxString ancestor;
                 while (components.size() > 0)
                 {
-                    wxString token = components.front();
+                    wxString tempToken = components.front();
                     components.pop();

                     if (!ancestor.IsEmpty())
                         ancestor << _T(' ');
-                    ancestor << token;
-                    ReadClsNames(ancestor);
+                    ancestor << tempToken;
                 }
+                ReadClsNames(ancestor);
             }
         }
         else if (token == ParserConsts::kw_enum)
@@ -1989,11 +1990,9 @@
         else if (current == _T("*"))
         {
             m_IsPointer = true;
-            continue;
+            //continue;
         }
-        else if (   wxIsalpha(current.GetChar(0))
-                 && (   (m_Tokenizer.PeekToken() == ParserConsts::semicolon)
-                     || (m_Tokenizer.PeekToken() == ParserConsts::comma)) )
+        else if ((wxIsalpha(current.GetChar(0)) || current.GetChar(0) == '_') )
         {
             TRACE(_T("ReadClsNames() : Adding variable '%s' as '%s' to '%s'"),
                   current.wx_str(),
@@ -2014,6 +2013,7 @@
             m_Tokenizer.UngetToken();
             break;
         }
+
     }
}

Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

blueshake

I have discussed this with ollydbg,to avoid you do the second time of the issue.I put it here,not test it seriously. :D
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

oBFusCATed

Quote from: blueshake on January 19, 2010, 01:04:22 PM
I have discussed this with ollydbg,to avoid you do the second time of the issue.I put it here,not test it seriously. :D

Morten don't you think there is a need for another CC branch?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: oBFusCATed on January 19, 2010, 01:14:20 PM
Morten don't you think there is a need for another CC branch?
I thought about that already (a lot!)... But I won't be able to maintain another branch, I am already trying hard to keep 4 different copies in sync. As you see: Not without errors. ;-)

However, we still have the CC branch. So all what's needed is to re-active it by merging from trunk. I'll see what I can do...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Quote from: MortenMacFly on January 19, 2010, 01:59:30 PM
Quote from: oBFusCATed on January 19, 2010, 01:14:20 PM
Morten don't you think there is a need for another CC branch?
I thought about that already (a lot!)... But I won't be able to maintain another branch, I am already trying hard to keep 4 different copies in sync. As you see: Not without errors. ;-)

However, we still have the CC branch. So all what's needed is to re-active it by merging from trunk. I'll see what I can do...
If you re-active the CC branch, please write a post in the CodeCompletion redesign sub-forum. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

Why did you do this:
Quote from: blueshake on January 19, 2010, 01:01:28 PM
Index: src/plugins/codecompletion/parser/parserthread.cpp
===================================================================
--- src/plugins/codecompletion/parser/parserthread.cpp (revision 6090)
+++ src/plugins/codecompletion/parser/parserthread.cpp (working copy)
@@ -1989,11 +1990,9 @@
         else if (current == _T("*"))
         {
             m_IsPointer = true;
-            continue;
+            //continue;
         }
-        else if (   wxIsalpha(current.GetChar(0))
-                 && (   (m_Tokenizer.PeekToken() == ParserConsts::semicolon)
-                     || (m_Tokenizer.PeekToken() == ParserConsts::comma)) )
+        else if ((wxIsalpha(current.GetChar(0)) || current.GetChar(0) == '_') )
         {
             TRACE(_T("ReadClsNames() : Adding variable '%s' as '%s' to '%s'"),
                   current.wx_str(),
@@ -2014,6 +2013,7 @@
             m_Tokenizer.UngetToken();
             break;
         }
+
     }
}

?!
How is this related to the typedef problem?

BTW: Did you notice the similarity between the ReadClsNames() and ReadVarNames() method?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

blueshake

#55
Quote
BTW: Did you notice the similarity between the ReadClsNames() and ReadVarNames() method?


yes.



actually the issue is caused by the ReadClsNames(most) in the typedef handle. :D

the codes below:

-        else if (   wxIsalpha(current.GetChar(0))
-                 && (   (m_Tokenizer.PeekToken() == ParserConsts::semicolon)
-                     || (m_Tokenizer.PeekToken() == ParserConsts::comma)) )




if you debug,you will find that if condition cannt be got in and cause the infinite loop.



of course the codes have effor on it too.

                    if (!ancestor.IsEmpty())
                        ancestor << _T(' ');
-                    ancestor << token;
-                    ReadClsNames(ancestor);
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Loaden

Two questions.
1. Global namepace there are problems with the plug-sshot-1.png. This problem has been resolved here:http://forums.next.codeblocks.org/index.php/topic,11804.msg80702.html#msg80702
#include <iostream>
#include <windows.h>
#include <winbase.h>
#include <string>
#include <map>
#include <vector>

int main()
{
    ::
    return 0;
}


[attachment deleted by admin]

Loaden

#57
2. VC project, CPU still 50% overload.

I found here, is not change:
-        else if (   wxIsalpha(current.GetChar(0))
-                 && (   (m_Tokenizer.PeekToken() == ParserConsts::semicolon)
-                     || (m_Tokenizer.PeekToken() == ParserConsts::comma)) )
+        else if ((wxIsalpha(current.GetChar(0)) || current.GetChar(0) == '_') )
         {
             TRACE(_T("ReadClsNames() : Adding variable '%s' as '%s' to '%s'"),
                   current.wx_str(),
@@ -2014,6 +2013,7 @@
             m_Tokenizer.UngetToken();
             break;
         }
+


The code here looks not applied. If you modify the code here, it can solve the CPU overload.

and here:
        else if (token == _T("*"))
        {
            m_IsPointer = false;
            continue;
        }
        else if (peek == ParserConsts::comma)
        {
            m_Tokenizer.UngetToken();
            if (components.size() != 0)
            {
                wxString ancestor;
                while (components.size() > 0)
                {
                    wxString token = components.front();
                    components.pop();

                    if (!ancestor.IsEmpty())
                        ancestor << _T(' ');
                    ancestor << token;
                }
                ReadClsNames(ancestor);
            }

token variables at different scope, readability is not good.

[attachment deleted by admin]

Xaviou

Ubuntu 8.04 to 9.10 Amd64 tar.gz archive (containing '.deb' installers builds with wx2810 from wxWidgets's repository) can be found  here.
".mo" file for french translation can be founded here (see below for installation instructions)
Full Win32 French Version (including wxWidgets and MinGW dlls and french ".mo" files) can be founded here

Installing french files:

  • extract the ".mo" file from the zip archive
  • under Linux : put this file in /usr/share/codeblocks/locale/fr_FR/ (you'll have to create these folders the first time) : don't forget to remove old file(s) before.
  • under Windows : put this file in $CodeBlocks_Install_Dir\share\CodeBlocks\locale\fr_FR\ (you'll have to create these folders the first time) : don't forget to remove old file(s) before

Regards
Xav'
My wxWidgets's stuff : [url="https://wxstuff.xaviou.fr/"]https://wxstuff.xaviou.fr/[/url]

pasgui

Build for Ubuntu i386/amd64 can be found here (howto)

wxWidgets for amd64:
- From Hardy Heron 8.04 to Jaunty Jacklope 9.04: wxWidgets from http://www.wxwidgets.org (howto)
- For Karmic Koala 9.10: wxWidgets from http://www.wxwidgets.org with jaunty-wx for the distribution (howto)
wxWidgets for i386:
- From Hardy Heron 8.04 to Jaunty Jacklope 9.04: wxWidgets from http://www.wxwidgets.org (howto)
- For Karmic Koala 9.10: wxWidgets from Ubuntu (universe)

Also included in the codeblocks-fr package (in the same repository), the french translation.

Best regards, pasgui