Author Topic: The 16 January 2010 build (6088) is out.  (Read 181601 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: The 16 January 2010 build (6088) is out.
« Reply #45 on: January 19, 2010, 11:37:36 am »
I think this is strange behaviour of CC:
Code
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?

Offline critic

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: The 16 January 2010 build (6088) is out.
« Reply #46 on: January 19, 2010, 11:55:44 am »
But in Eclipse the same example works fine with 20 and over recursions. Is it's CC engine independent of recursions count?  :?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: The 16 January 2010 build (6088) is out.
« Reply #47 on: January 19, 2010, 12:23:39 pm »
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 16 January 2010 build (6088) is out.
« Reply #48 on: January 19, 2010, 12:42:06 pm »
I find the bug why the parser get stuck when parsing the VC 2005 header files:
Well done.

So, there is a logic error in handling typedef statement....
True.
You pointed correctly to:
Code
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: The 16 January 2010 build (6088) is out.
« Reply #49 on: January 19, 2010, 01:01:28 pm »
@morten

you can try this patch:


Code
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?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: The 16 January 2010 build (6088) is out.
« Reply #50 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
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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 16 January 2010 build (6088) is out.
« Reply #51 on: January 19, 2010, 01:14:20 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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 16 January 2010 build (6088) is out.
« Reply #52 on: January 19, 2010, 01:59:30 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 16 January 2010 build (6088) is out.
« Reply #53 on: January 19, 2010, 02:15:03 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 16 January 2010 build (6088) is out.
« Reply #54 on: January 19, 2010, 02:22:35 pm »
Why did you do this:
Code
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: The 16 January 2010 build (6088) is out.
« Reply #55 on: January 19, 2010, 02:30:58 pm »
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:

Code
-        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.

Code
                     if (!ancestor.IsEmpty())
                         ancestor << _T(' ');
-                    ancestor << token;
-                    ReadClsNames(ancestor);
« Last Edit: January 22, 2010, 08:16:08 am by blueshake »
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?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 16 January 2010 build (6088) is out.
« Reply #56 on: January 19, 2010, 03:57:54 pm »
Two questions.
1. Global namepace there are problems with the plug-sshot-1.png. This problem has been resolved here:http://forums.codeblocks.org/index.php/topic,11804.msg80702.html#msg80702
Code
#include <iostream>
#include <windows.h>
#include <winbase.h>
#include <string>
#include <map>
#include <vector>

int main()
{
    ::
    return 0;
}

[attachment deleted by admin]

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: The 16 January 2010 build (6088) is out.
« Reply #57 on: January 19, 2010, 04:02:17 pm »
2. VC project, CPU still 50% overload.

I found here, is not change:
Code
-        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]
« Last Edit: January 19, 2010, 04:11:09 pm by Loaden »

Offline Xaviou

  • Regular
  • ***
  • Posts: 402
    • X@v's wxStuff
Re: The 16 January 2010 build (6088) is out.
« Reply #58 on: January 20, 2010, 08:34:12 am »
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'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline pasgui

  • Almost regular
  • **
  • Posts: 165
    • LGP
Re: The 16 January 2010 build (6088) is out.
« Reply #59 on: January 20, 2010, 10:14:01 am »
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