News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

CodeCompletion r5979 problems

Started by koso, December 16, 2009, 10:40:03 AM

Previous topic - Next topic

koso

I have some strange problems with latest CC .. this is my test code:


void getBase(int n) {
}

int main() {
    return 0;
}

On first project startup is everything as expected .. but after first change with save, list of global function symbols is updated, and it shows two symbols with names "e(" and "n(". Type of the first (from debug tool) is "v o i d g e t B a s". Also sometimes when i add somewhere space, after save, there are no symbols at all ...

The only solution I found is to delete .layout file for project and restart C::B, but next save, ant it is again broken ... anyone with the same problems?

blueshake

@koso
Does it work withou save??????
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 download the svn 5979 and confirm it ,but in my local copy it work well.seems something is wrong.
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

haha,get the reason.
patch:
Index: src/include/filemanager.h
===================================================================
--- src/include/filemanager.h (revision 5979)
+++ src/include/filemanager.h (working copy)
@@ -144,7 +144,19 @@
     NullLoader(const wxString& name, char* buffer, size_t size) { fileName = name; data = buffer; len = size; Ready(); };
     void operator()(){};
};
-
+class EditorReuser : public LoaderBase
+{
+public:
+    EditorReuser(const wxString& name, const wxString& s)
+    {
+        fileName = name;
+        len = strlen(s.mb_str(wxConvUTF8));
+        data = new char[len + 1];
+        strcpy(data, (const char*)s.mb_str(wxConvUTF8));
+        Ready();
+    }
+    void operator()(){};
+};
// ***** class: FileManager *****
class FileManager : public Mgr<FileManager>
{
Index: src/sdk/filemanager.cpp
===================================================================
--- src/sdk/filemanager.cpp (revision 5979)
+++ src/sdk/filemanager.cpp (working copy)
@@ -138,12 +138,8 @@
                 cbEditor* ed = em->GetBuiltinEditor(em->GetEditor(i));
                 if(ed && fileName == ed->GetFilename())
                 {
-                    wxString s(ed->GetControl()->GetText());
-                    #if wxCHECK_VERSION(2, 9, 0)
-                    NullLoader *nl = new NullLoader(file, (char*) s.wx_str(), s.length() * sizeof(wxChar));
-                    #else
-                    NullLoader *nl = new NullLoader(file, (char*) s.c_str(), s.length() * sizeof(wxChar));
-                    #endif
+
+                    EditorReuser *nl = new EditorReuser(file, ed->GetControl()->GetText());
                     return nl;
                 }
             }
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?

MortenMacFly

Quote from: blueshake on December 16, 2009, 11:26:43 AM
haha,get the reason.
Dammed. My fault. Actually this slipped in when I committed ollydbg's patch. I'll fix this in SVN asap...
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]

koso

#5
This is how i can reproduce it

1. create c++ console project with test code
2. open main.cpp, symbol browser and code completion works as expected
3. close project (this should generate layout file)
4. start project again = now symbols list is broken ..

so it is broken even without any save ...  

btw. platform is WinXP 32 bit.

EDIT: thansk for fix, you made path faster than I replied :D

MortenMacFly

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]

Jenna

Quote from: MortenMacFly on December 16, 2009, 11:38:18 AM
Quote from: MortenMacFly on December 16, 2009, 11:28:32 AM
I'll fix this in SVN asap....
Done. Thanks for the report.

I just wanted to do the same, because on my system it leads to a crash in NullLoader dtor (debian 64-bit).
Not so hard to find because of a (more or less) meaningful backtrace and the NullLoader-discussion, but I was not fast enough with commiting.

MortenMacFly

Quote from: jens on December 16, 2009, 11:44:47 AM
but I was not fast enough with commiting.
So in other words you are lame today. :lol: :lol: :lol:
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]

Jenna

Quote from: MortenMacFly on December 16, 2009, 11:49:12 AM
Quote from: jens on December 16, 2009, 11:44:47 AM
but I was not fast enough with commiting.
So in other words you are lame today. :lol: :lol: :lol:

Not only today  :) ,

but in fact I'm at work, and should do anything with C::B at the moment, but I saw this thread and just wanted to test it and ...

killerbot

I indeed also had crashes when whatever project was loaded.

No just update, but make or make clean now gives the following error :

rm: cannot remove `.libs/tinystr.o': Permission denied
rm: cannot remove `.libs/tinystr.o': Permission denied
g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../src/include/wxscintilla/include -I../../../src/include -I../../../src/include/tinyxml -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT tinystr.lo -MD -MP -MF .deps/tinystr.Tpo -c tinystr.cpp  -fPIC -DPIC -o .libs/tinystr.o
Assembler messages:
Fatal error: can't create .libs/tinystr.o: Permission denied
make[3]: *** [tinystr.lo] Error 1
make[3]: Leaving directory `/home/lieven/Projects/Codeblocks/trunk/src/base/tinyxml'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/lieven/Projects/Codeblocks/trunk/src/base'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lieven/Projects/Codeblocks/trunk/src'
make: *** [all-recursive] Error 1

Jenna

Quote from: killerbot on December 16, 2009, 02:37:33 PM
I indeed also had crashes when whatever project was loaded.

No just update, but make or make clean now gives the following error :

rm: cannot remove `.libs/tinystr.o': Permission denied
rm: cannot remove `.libs/tinystr.o': Permission denied
g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../src/include/wxscintilla/include -I../../../src/include -I../../../src/include/tinyxml -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT tinystr.lo -MD -MP -MF .deps/tinystr.Tpo -c tinystr.cpp  -fPIC -DPIC -o .libs/tinystr.o
Assembler messages:
Fatal error: can't create .libs/tinystr.o: Permission denied
make[3]: *** [tinystr.lo] Error 1
make[3]: Leaving directory `/home/lieven/Projects/Codeblocks/trunk/src/base/tinyxml'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/lieven/Projects/Codeblocks/trunk/src/base'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lieven/Projects/Codeblocks/trunk/src'
make: *** [all-recursive] Error 1


No problems here.

Did you accidently run a make or make install as root or via sudo.
For make install you need to be root if you do not install in your home-directory, of course, but if the sources have not been build before running make install, make is called automatically as root, what leads to the exact same error as you have.

killerbot

yep, something like that must have happened, sudo make clean, and then again regular make and sudo make install fixed it.