Author Topic: Release 15.12, RC1 has arrived  (Read 42292 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 4975
Release 15.12, RC1 has arrived
« on: November 22, 2015, 09:13:15 pm »
RC1 candidate (i.e. full installer) of new Code::Blocks release for Windows can be found here:
http://sourceforge.net/projects/codeblocks/files/Binaries/15.12-RC1/codeblocks-15.12-setup-RC1.exe

...the same, but bundled with MinGW:
http://sourceforge.net/projects/codeblocks/files/Binaries/15.12-RC1/codeblocks-15.12mingw-setup-RC1.exe


Linux packages are here:
TO BE ADDED

Any feedback is welcome. Please consider that we are in "feature freeze", which means no new features will make it into the next release, but urgent bug-fixes.

Report back in this forum:
http://forums.codeblocks.org/index.php/board,7.0.html
...precisely here:
http://forums.codeblocks.org/index.php/topic,20730.0.html
« Last Edit: November 22, 2015, 09:16:47 pm by killerbot »

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Release 15.12, RC1 has arrived
« Reply #1 on: November 24, 2015, 06:19:21 am »
Not tested yet, but good job !
Kernel Extremist - PedroM power

Offline ffs

  • Single posting newcomer
  • *
  • Posts: 1
Re: Release 15.12, RC1 has arrived
« Reply #2 on: November 29, 2015, 03:03:17 pm »
Hello.

I have problem with code completion with this release.

When I type this code:
Code: [Select]
#include <iostream>
#include <vector>

int main()
{
    std::vector<int> v;
   
    v.
   
    return 0;
}

and after v. I should get code completion.
BUT when I type using namespace std;
and just vector<int> v; then when I type v. everything works good.

Ctrl + Space doesn't work, reparsing project also doesn't work.

Why?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7106
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Release 15.12, RC1 has arrived
« Reply #3 on: December 08, 2015, 05:54:01 am »
From what I see at the SourceForge Website is 15-12 RC1 is downloadable for Windows 8, 7, Vista only.
Does anyone know if it will work with Windows 10 64 bit?
The nightlies did, so there is no cause to believe the rc1 does not.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9405
Re: Release 15.12, RC1 has arrived
« Reply #4 on: December 08, 2015, 01:28:53 pm »
From what I see at the SourceForge Website is 15-12 RC1 is downloadable for Windows 8, 7, Vista only.
What makes you say so? I don't see such limitation...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline NearTox

  • Single posting newcomer
  • *
  • Posts: 1
Re: Release 15.12, RC1 has arrived
« Reply #5 on: December 08, 2015, 04:05:59 pm »
Ctrl + Space doesn't work, reparsing project also doesn't work.

Why?

It's a problem with CC(Code Completion), specifically with the macros replacement (Replacement tokens), that was erased or are missed (after of the nightly build 10320)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #6 on: December 09, 2015, 03:33:25 pm »
Hello.

I have problem with code completion with this release.

When I type this code:
Code: [Select]
#include <iostream>
#include <vector>

int main()
{
    std::vector<int> v;
   
    v.
   
    return 0;
}

and after v. I should get code completion.
BUT when I type using namespace std;
and just vector<int> v; then when I type v. everything works good.

Ctrl + Space doesn't work, reparsing project also doesn't work.

Why?
Fine here, see the screen shot:

I use the wx3.0.2 and c::b trunk under windows(rev10609)
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: 9405
Re: Release 15.12, RC1 has arrived
« Reply #7 on: December 09, 2015, 08:39:19 pm »
I use the wx3.0.2 and c::b trunk under windows(rev10609)
I use wx 2.8.12 and GCC 5.1.0 and it does not work at all. I think it does not work for others, too this way...

And it is our fault because if I revert back to r10437 it works for me on the same setup...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #8 on: December 10, 2015, 01:10:11 am »
@morten:
I think I may found some reason.
I do have some tiny CC patches against the trunk, but I think that doesn't cause the "fix". The reason is that when I test my own build, I see it use an quite old gcc 4.7 compiler, so our parser can parse the headers from this gcc.

When I test the nightly build rev10574 or my own build c::b with the mingw build 5.2 from mingw-w64 site, and the "v." dose not show any code suggestion, so it looks like our parser fails to parse the newer gcc's header.

I will look into it.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #9 on: December 10, 2015, 01:26:11 am »
I see I found the reason, it is a bug in parsing the code: (both gcc 4.7 and 5.2 have such code)
Code: [Select]
namespace std _GLIBCXX_VISIBILITY(default)
{
...
}
especially expanding the _GLIBCXX_VISIBILITY(default) macro usage.

Under testing of GCC 4.7 or GCC 5.2, I can find the the definition of _GLIBCXX_VISIBILITY, they both point to:
Code: [Select]
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
While, under GCC 5.2, I can't find the definition of _GLIBCXX_PSEUDO_VISIBILITY, while under 4.7, I can. That's the point.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #10 on: December 10, 2015, 01:44:01 am »
To simplify the issue, you can simply create a simple cpp file, which does not include any other files:

Code: [Select]
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
namespace std _GLIBCXX_VISIBILITY(default)
{
    class vector
    {
        size_t size();
    }
}

Then, you can type "std::"
If the std namespace is parse correctly, then you should show "std::vector", but actually it is not.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #11 on: December 10, 2015, 01:50:15 am »
Code: [Select]
void ParserThread::HandleNamespace()
{
    wxString ns = m_Tokenizer.GetToken();
    int line = m_Tokenizer.GetLineNumber();

    if (ns == ParserConsts::opbrace)
    {
        // parse inside anonymous namespace
        Token*     lastParent = m_LastParent;
        TokenScope lastScope  = m_LastScope;

        DoParse();

        m_LastParent = lastParent;
        m_LastScope   = lastScope;
    }
    else
    {
        // for namespace aliases to be parsed, we need to tell the tokenizer
        // not to skip the usually unwanted tokens. One of those tokens is the
        // "assignment" (=).
        // we just have to remember to revert this setting below, or else problems will follow
        m_Tokenizer.SetState(tsNormal);

        wxString next = m_Tokenizer.PeekToken(); // named namespace
        if (next==ParserConsts::opbrace)
        {
            m_Tokenizer.SetState(tsNormal);

            // use the existing copy (if any)
            Token* newToken = TokenExists(ns, m_LastParent, tkNamespace);
            if (!newToken)
                newToken = DoAddToken(tkNamespace, ns, line);
            if (!newToken)
            {
                TRACE(_T("HandleNamespace() : Unable to create/add new token: ") + ns);
                return;
            }

            m_Tokenizer.GetToken(); // eat {
            int lineStart = m_Tokenizer.GetLineNumber();

            Token*     lastParent = m_LastParent; // save status, will restore after DoParse()
            TokenScope lastScope  = m_LastScope;

            m_LastParent = newToken;
            // default scope is: public for namespaces (actually no, but emulate it)
            m_LastScope   = tsPublic;

            DoParse();

            m_LastParent = lastParent;
            m_LastScope   = lastScope;

            // update implementation file and lines of namespace.
            // this doesn't make much sense because namespaces are all over the place,
            // but do it anyway so that buffer-based parsing returns the correct values.
            newToken->m_ImplFileIdx   = m_FileIdx;
            newToken->m_ImplLine      = line;
            newToken->m_ImplLineStart = lineStart;
            newToken->m_ImplLineEnd   = m_Tokenizer.GetLineNumber();
        }
        else if (next==ParserConsts::equals)
        {
            // namespace alias; example from cxxabi.h:
            //
            // namespace __cxxabiv1
            // {
            // ...
            // }
            // namespace abi = __cxxabiv1; <-- we 're in this case now

            m_Tokenizer.GetToken(); // eat '='
            m_Tokenizer.SetState(tsNormal);

            Token* lastParent = m_LastParent;
            Token* aliasToken = NULL;

            while (IS_ALIVE)
            {
                wxString aliasStr = m_Tokenizer.GetToken();

                // use the existing copy (if any)
                aliasToken = TokenExists(aliasStr, m_LastParent, tkNamespace);
                if (!aliasToken)
                    aliasToken = DoAddToken(tkNamespace, aliasStr, line);
                if (!aliasToken)
                    return;

                if (m_Tokenizer.PeekToken() == ParserConsts::dcolon)
                {
                    m_Tokenizer.GetToken();
                    m_LastParent = aliasToken;
                }
                else
                    break;
            }

            aliasToken->m_Aliases.Add(ns);
            m_LastParent = lastParent;
        }
        else
        {
            m_Tokenizer.SetState(tsNormal);
            // probably some kind of error in code ?
            SkipToOneOfChars(ParserConsts::semicolonopbrace);
        }
    }
}
For the above code, I see that it finally run the SkipToOneOfChars(ParserConsts::semicolonopbrace);
So that the "{" is skipped, thus the "vector" token is put in the global namespace.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #12 on: December 10, 2015, 01:58:24 am »
In the above example, the three token will be skipped from the function SkipToOneOfChars(ParserConsts::semicolonopbrace);
Code: [Select]
1, _GLIBCXX_PSEUDO_VISIBILITY
2, (default)
3, {
I think the fix should be:
If we skip from the "{", we should handle it like the code before:
Code: [Select]
   wxString next = m_Tokenizer.PeekToken(); // named namespace
        if (next==ParserConsts::opbrace)
        {
            m_Tokenizer.SetState(tsNormal);

            // use the existing copy (if any)
            Token* newToken = TokenExists(ns, m_LastParent, tkNamespace);
            if (!newToken)
                newToken = DoAddToken(tkNamespace, ns, line);
            if (!newToken)
            {
                TRACE(_T("HandleNamespace() : Unable to create/add new token: ") + ns);
                return;
            }

            m_Tokenizer.GetToken(); // eat {
            int lineStart = m_Tokenizer.GetLineNumber();

            Token*     lastParent = m_LastParent; // save status, will restore after DoParse()
            TokenScope lastScope  = m_LastScope;

            m_LastParent = newToken;
            // default scope is: public for namespaces (actually no, but emulate it)
            m_LastScope   = tsPublic;

            DoParse();
            ...
            ...

The function DoParse() will carefully parse the body inside the "{ .... }", and put the "class vector" as a child of std namespace.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4840
  • Interests on OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Release 15.12, RC1 has arrived
« Reply #13 on: December 10, 2015, 02:27:52 am »
This is the patch to fix such issue:
Code: [Select]
src/plugins/codecompletion/parser/parserthread.cpp | 166 ++++++++++++---------
 1 file changed, 97 insertions(+), 69 deletions(-)

diff --git a/src/plugins/codecompletion/parser/parserthread.cpp b/src/plugins/codecompletion/parser/parserthread.cpp
index a22cb61..bd9a31f 100644
--- a/src/plugins/codecompletion/parser/parserthread.cpp
+++ b/src/plugins/codecompletion/parser/parserthread.cpp
@@ -1762,95 +1762,123 @@ void ParserThread::HandleNamespace()
     }
     else
     {
-        // for namespace aliases to be parsed, we need to tell the tokenizer
-        // not to skip the usually unwanted tokens. One of those tokens is the
-        // "assignment" (=).
-        // we just have to remember to revert this setting below, or else problems will follow
-        m_Tokenizer.SetState(tsNormal);
 
-        wxString next = m_Tokenizer.PeekToken(); // named namespace
-        if (next==ParserConsts::opbrace)
+        while (true)
         {
+            // for namespace aliases to be parsed, we need to tell the tokenizer
+            // not to skip the usually unwanted tokens. One of those tokens is the
+            // "assignment" (=).
+            // we just have to remember to revert this setting below, or else problems will follow
             m_Tokenizer.SetState(tsNormal);
 
-            // use the existing copy (if any)
-            Token* newToken = TokenExists(ns, m_LastParent, tkNamespace);
-            if (!newToken)
-                newToken = DoAddToken(tkNamespace, ns, line);
-            if (!newToken)
+            wxString next = m_Tokenizer.PeekToken(); // named namespace
+            if (next==ParserConsts::opbrace)
             {
-                TRACE(_T("HandleNamespace() : Unable to create/add new token: ") + ns);
-                return;
-            }
+                m_Tokenizer.SetState(tsNormal);
 
-            m_Tokenizer.GetToken(); // eat {
-            int lineStart = m_Tokenizer.GetLineNumber();
+                // use the existing copy (if any)
+                Token* newToken = TokenExists(ns, m_LastParent, tkNamespace);
+                if (!newToken)
+                    newToken = DoAddToken(tkNamespace, ns, line);
+                if (!newToken)
+                {
+                    TRACE(_T("HandleNamespace() : Unable to create/add new token: ") + ns);
+                    return;
+                }
 
-            Token*     lastParent = m_LastParent; // save status, will restore after DoParse()
-            TokenScope lastScope  = m_LastScope;
+                m_Tokenizer.GetToken(); // eat {
+                int lineStart = m_Tokenizer.GetLineNumber();
 
-            m_LastParent = newToken;
-            // default scope is: public for namespaces (actually no, but emulate it)
-            m_LastScope   = tsPublic;
+                Token*     lastParent = m_LastParent; // save status, will restore after DoParse()
+                TokenScope lastScope  = m_LastScope;
 
-            DoParse();
+                m_LastParent = newToken;
+                // default scope is: public for namespaces (actually no, but emulate it)
+                m_LastScope   = tsPublic;
 
-            m_LastParent = lastParent;
-            m_LastScope   = lastScope;
-
-            // update implementation file and lines of namespace.
-            // this doesn't make much sense because namespaces are all over the place,
-            // but do it anyway so that buffer-based parsing returns the correct values.
-            newToken->m_ImplFileIdx   = m_FileIdx;
-            newToken->m_ImplLine      = line;
-            newToken->m_ImplLineStart = lineStart;
-            newToken->m_ImplLineEnd   = m_Tokenizer.GetLineNumber();
-        }
-        else if (next==ParserConsts::equals)
-        {
-            // namespace alias; example from cxxabi.h:
-            //
-            // namespace __cxxabiv1
-            // {
-            // ...
-            // }
-            // namespace abi = __cxxabiv1; <-- we 're in this case now
-
-            m_Tokenizer.GetToken(); // eat '='
-            m_Tokenizer.SetState(tsNormal);
+                DoParse();
 
-            Token* lastParent = m_LastParent;
-            Token* aliasToken = NULL;
+                m_LastParent = lastParent;
+                m_LastScope   = lastScope;
 
-            while (IS_ALIVE)
+                // update implementation file and lines of namespace.
+                // this doesn't make much sense because namespaces are all over the place,
+                // but do it anyway so that buffer-based parsing returns the correct values.
+                newToken->m_ImplFileIdx   = m_FileIdx;
+                newToken->m_ImplLine      = line;
+                newToken->m_ImplLineStart = lineStart;
+                newToken->m_ImplLineEnd   = m_Tokenizer.GetLineNumber();
+
+                // the namespace body is correctly parsed
+                break;
+            }
+            else if (next==ParserConsts::equals)
             {
-                wxString aliasStr = m_Tokenizer.GetToken();
+                // namespace alias; example from cxxabi.h:
+                //
+                // namespace __cxxabiv1
+                // {
+                // ...
+                // }
+                // namespace abi = __cxxabiv1; <-- we 're in this case now
 
-                // use the existing copy (if any)
-                aliasToken = TokenExists(aliasStr, m_LastParent, tkNamespace);
-                if (!aliasToken)
-                    aliasToken = DoAddToken(tkNamespace, aliasStr, line);
-                if (!aliasToken)
-                    return;
+                m_Tokenizer.GetToken(); // eat '='
+                m_Tokenizer.SetState(tsNormal);
 
-                if (m_Tokenizer.PeekToken() == ParserConsts::dcolon)
+                Token* lastParent = m_LastParent;
+                Token* aliasToken = NULL;
+
+                while (IS_ALIVE)
                 {
-                    m_Tokenizer.GetToken();
-                    m_LastParent = aliasToken;
+                    wxString aliasStr = m_Tokenizer.GetToken();
+
+                    // use the existing copy (if any)
+                    aliasToken = TokenExists(aliasStr, m_LastParent, tkNamespace);
+                    if (!aliasToken)
+                        aliasToken = DoAddToken(tkNamespace, aliasStr, line);
+                    if (!aliasToken)
+                        return;
+
+                    if (m_Tokenizer.PeekToken() == ParserConsts::dcolon)
+                    {
+                        m_Tokenizer.GetToken();
+                        m_LastParent = aliasToken;
+                    }
+                    else
+                        break;
                 }
+
+                aliasToken->m_Aliases.Add(ns);
+                m_LastParent = lastParent;
+
+                // the namespace alias statement is correctly parsed
+                break;
+            }
+            else
+            {
+                m_Tokenizer.SetState(tsNormal);
+                // probably some kind of error in code ?
+                SkipToOneOfChars(ParserConsts::semicolonopbrace);
+
+                // in case of the code:
+                //
+                //    # define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
+                //    namespace std _GLIBCXX_VISIBILITY(default)
+                //    {
+                //        class vector
+                //        {
+                //            size_t size();
+                //        }
+                //    }
+                // we still want to parse the body of the namespace, but skip the tokens before "{"
+                m_Tokenizer.UngetToken();
+                wxString peek = m_Tokenizer.PeekToken();
+                if(peek == ParserConsts::opbrace)
+                    continue;
                 else
                     break;
             }
-
-            aliasToken->m_Aliases.Add(ns);
-            m_LastParent = lastParent;
-        }
-        else
-        {
-            m_Tokenizer.SetState(tsNormal);
-            // probably some kind of error in code ?
-            SkipToOneOfChars(ParserConsts::semicolonopbrace);
-        }
+        } // while(true)
     }
 }
 

Please test and give feedback. The method I use is: I just check which token is skipped by the SkipToOneOfChars(), if it is the "{", then I need to still parse it as the beginning of the namespace body.

The issue I see that, when I hit the dot, I see the suggestion window pop up, and disappeared quickly, so no suggestion after the dot. I'm not sure the reason. But if I continue enter the member function, like "push_", I get the correct result, see the image shot below:


The patch is in GIT style, so you need the patch utility to apply it in your local copy.
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: 9405
Re: Release 15.12, RC1 has arrived
« Reply #14 on: December 10, 2015, 09:21:02 am »
This is the patch to fix such issue:
That looks very good - its working for me again now.

Great work! I'll some some more testing on larger projects but so far I see no negative side-effects. If you commit, please also add the source snippet to the test cases.

BTW: The patch applied as-it-is just fine.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ