#include <iostream>
#include <vector>
int main()
{
std::vector<int> v;
v.
return 0;
}
From what I see at the SourceForge Website is 15-12 RC1 is downloadable for Windows 8, 7, Vista only.The nightlies did, so there is no cause to believe the rc1 does not.
Does anyone know if it will work with Windows 10 64 bit?
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...?!
Ctrl + Space doesn't work, reparsing project also doesn't work.
Why?
Hello.Fine here, see the screen shot:
I have problem with code completion with this release.
When I type this code:Code#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?
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...
namespace std _GLIBCXX_VISIBILITY(default)
{
...
}
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
namespace std _GLIBCXX_VISIBILITY(default)
{
class vector
{
size_t size();
}
}
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);
}
}
}
1, _GLIBCXX_PSEUDO_VISIBILITY
2, (default)
3, {
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();
...
...
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)
}
}
This is the patch to fix such issue:That looks very good - its working for me again now.
Grad to see that the patch works OK from your side.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.
nanyu: What build are you testing with?It really does not work. Its a rather new feature of C++ we didn't account for in the parser yet.
Uf, I thought this is the same case as the one ollydbg has just fixed.No, its related to the assignment of the vector with values w/o the equal sign. So that is a different story. It should be doable, but I'm afraid we might break other things, thats why I would postpone it.
I suppose the new Debian version from jenslody is RC1? svn build rev 10611.The main problem with my Debian packages is, that they are linked against wx3.0.
It worked a lot better than last nightly build so far, but got one crash when I was clicking to open a second project via the "File" - "Recent projects".
Last console output:
Switching layout to "GDB/CDB debugger:Default"
(codeblocks:2591): Gtk-CRITICAL **: IA__gtk_widget_set_size_request: assertion 'width >= -1' failed
Switching layout to "Code::Blocks default"
Crashlog is appended.
System is Debian Jessie 64 bit.
I could not reproduce the bug so far :-(
@jens: Is it still worth reporting wx3.0 crashes? Last evening I spend another few hours with your build - and unfortunately I got so many crashes that it's getting hard to code with it. Especially when doing global global search&replace with many files. I sometimes got several crashes within minutes when refactoring code. Never easy reproducible, but always happening after a working with it a while. And generally getting some asserts first like the one above.I do not work on Debian, and use C::B with wx3 in maost cases with disabled Codecompletion-plugin.
I'd like to help with reports - can also start from console and enable additional output etc if that is possible. But given the amount of crashes I had, I suppose you probably still get them yourself enough anyway. So not sure if it's worth reporting each one currently?
Do you have the option to sync the editor and the project tree enabled?Hm, help me - I'm not finding that option so far.
Also can you share your project or checkout the codeblocks' source code and try to reproduce it with some of the projects or workspaces in it?The project I've been working on is this one: https://bitbucket.org/mzeilfelder/trunk_hc1
edit: Also have you added or removed some files to the workspace projects between the find in files and double clicking results?No, I didn't do that.
Hm, help me - I'm not finding that option so far.You'll know if you have this option enabled if when you switch between file the same file gets selected in the project tree.
I'm on the opposite.@ssawgift, both the two cases works fine here for the latest svn10625. Which compiler do you use?
Code completion works for me in your case. However, if do 'using namespace std' and 'vector<int> v', I won't get autocompletion.
BTW, I use CB RC1 on Windows XP.Hello.
I have problem with code completion with this release.
When I type this code:Code#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?
I just tested this compiler, and it works fine here on my system with the latest svn rev10626.@ssawgift, both the two cases works fine here for the latest svn10625. Which compiler do you use?I use gcc 4.9.3 built by MinGW-W64 project.
...
Oh, can you try to disable the symbol browser in the code completion settings?I think:running the gui function in non-main-thread is not a good idea. But building the tree really take a lot of time. :)
This one is known to cause problems, because it calls gui functions in non-main-thread.
Thank you! Whole evening without any crashes. Looks good so far :-)No crashes because of what? Disabling the symbol browser or something else?
Thank you! Whole evening without any crashes. Looks good so far :-)No crashes because of what? Disabling the symbol browser or something else?
I try to download codeblocks 15.12 release and Avast is reporting there is a Virus inside.What exactly did you download? Its not visible in the screenshot.
Is it a false positive or not?99.99999% likely a false positive. If unsure, please use services like virtustotal.com to see for yourself.
I try to download codeblocks 15.12 release and Avast is reporting there is a Virus inside.What exactly did you download? Its not visible in the screenshot.
Sorry, but I don't known this site (virustotal.com) and it's seems be a false positive (only 4 antivirus detect a Malware in it).Yes - that's typical for false-positive. The only way a virus can make it into the installer is if SourceForge gets hacked. But this would be recognized pretty fast I guess... 8)
Yes, this is a feature. You can easily order them in a single tab control.
What do you mean by "split the frame"?
It works the same as for editors.No highlight seen while moving one editor tab, but ended up with this (http://www.mediafire.com/view/8mz38flw5vzat42/tabs-04.png) : editor window splitted.
So don't keep on to the one you already have downloaded ;-)...and don't spy on what's not yet officially released. :-)
Until now I faced no critical problem for my work.That is good to know. And surely you can report stuff...
I see the target list is much smaller than before.Before what? It should size to "something" related to the longest target name.
I see the target list is much smaller than before.Before what? It should size to "something" related to the longest target name.
Please let me know the cause. What's wrong ?Most likely you mixed (wx-)debug with non-debug libraries / object files. Please note that this is not a C::B issue.
Buttons on bookmark toolbar do not work - clicking on them has no effect. But I assume this has already been fixed because it's so obvious.
Are you talking about the browse tracker toolbar?
Yes. They are not working (at least the toggle bookmark button). Interesting that no one has found this bug :D I use the browser tracker extensively but only over shortcuts, so i never had this problem..Hmmm... working for me. Are you sure you enabled the feature globally (Menu: View-> BrowseTracker -> Settings -> Enable BrowseMarks)?
Yes this was it, the toolbar is working. But i didn't knew that this are two different features... I used always the Edit->Bookmarks->Toggle Bookmarks. What is the difference?Yes. They are not working (at least the toggle bookmark button). Interesting that no one has found this bug :D I use the browser tracker extensively but only over shortcuts, so i never had this problem..Hmmm... working for me. Are you sure you enabled the feature globally (Menu: View-> BrowseTracker -> Settings -> Enable BrowseMarks)?
But i didn't knew that this are two different features... I used always the Edit->Bookmarks->Toggle Bookmarks. What is the difference?Jumpmarks should be more flexible in some ways... I actually don't know because for me, the bookmarks are just fine. What I can tell is that it requires another settings file (*.bmarks). Maybe oBFusCATed can say something about it...
I think i am a bit confused, about the difference between "Bookmarks" and "Browser Marks"
I think i am a bit confused, about the difference between "Bookmarks" and "Browser Marks"
BrowseMarks are the original "..." marks that were internal to the BrowseTracker plugin only. IE., CB knew nothing about them.
Many request were made to use CB bookmarks instead, so that option passes the information to CB to set a bookmark.
However, CB bookmarks were not global. They don't work across editors.
Setting BrowseTracker to use CB Bookmarks causes BrowseTracker to remember the BrowseMarks as well as the CB bookmarks.
I'll look at the problem and see if I can find out why the tool bar does not work with BrowseMarks.