Author Topic: Hanging for a while if no souce file, only header file  (Read 11601 times)

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Hanging for a while if no souce file, only header file
« on: April 09, 2012, 10:15:39 am »
Hello C::B Team,

I am not sure, if it already known problem and was already fixed, but...

On CPP projects, if in a project there is a header file with (for example) an interface Class, which has no implementation (only definition of a pure virtual class) and there is no source file for that (.cpp), on switching to this file from other files (browsing to them), first time CB hangs for a while (more, than 5 sec), all other switches to that file from other files takes not more but still 4 secs, what is quite annoying. And also, if you try to make some changes, on a first change and before the file saved and on a save itself, CB hangs also for about 4 secs.

If you add a empty .cpp file with the same name as .h file - this behavior is disappears.

I am still using bild 7477 and 5070. In both revs is the same behavior.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Hanging for a while if no souce file, only header file
« Reply #1 on: April 09, 2012, 10:52:32 am »
Try the latest nightly build and next time please post in the users sub-forums.
(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 MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #2 on: April 09, 2012, 11:18:39 am »
Sorry for the wrong thread.

Does latest build builds with wxWidgets 2.8.10?

For one month I didn't was successful with that.

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #3 on: April 09, 2012, 11:30:39 am »
Sorry again :)
Does latest build builds with wxWidgets 2.8.10?
For one month I didn't was successful with that.
This was in Linux Version. I'll try the latest now in Windows.

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #4 on: April 09, 2012, 12:51:26 pm »
Ok.
I did build last Rev of trunk. It works fine so far.
I'll examine it, but after 10 minutes of work I didn't observe that behavior yet.

And also a big projects are loading much faster, as it was earlier.

Great work!

Thanks a lot.

PS.
If any things, that I mentioned above, will occur again, I'll let you know about it.
« Last Edit: April 10, 2012, 11:22:28 am by MasterAlexei »

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #5 on: April 10, 2012, 10:19:06 pm »
Hello Codeblocks team,

I did try the last Rev of trunk 7929. The behavior is still there.
And I think, that it is Symbol Browser, who need a little bit more, to process the header file, that has no .cpp file pair.

Alexei

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Hanging for a while if no souce file, only header file
« Reply #6 on: April 11, 2012, 06:54:05 am »
I did try the last Rev of trunk 7929. The behavior is still there.
For the record:
I still cannot reproduce. In the C::B source tree we have pure virtual classes, too. They work just fine. Did you try to (temporarily) delete your configuration? Did you try to switch off  certain plugins to see when this behaviour goes away? If its really CC: Did you try to play with CC's settings to see if a specific setting causes such?
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 MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #7 on: April 11, 2012, 08:28:50 am »
For the record:
I still cannot reproduce. In the C::B source tree we have pure virtual classes, too. They work just fine. Did you try to (temporarily) delete your configuration? Did you try to switch off  certain plugins to see when this behaviour goes away? If its really CC: Did you try to play with CC's settings to see if a specific setting causes such?
This is what I am doing right now.
If you like, I can send you my project.

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #8 on: April 11, 2012, 09:04:57 am »
It is strange, but after I exported my project from my SVN in a dir, which is located some levels upper, as the origin project, CB works very well with it. I'll play a little bit with it some more time.

If in a week or two I'll not post here - then this problem can be closed, I think.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Hanging for a while if no souce file, only header file
« Reply #9 on: April 11, 2012, 09:17:30 am »
It is strange, but after I exported my project from my SVN in a dir, which is located some levels upper, as the origin project, CB works very well with it.
Do you have files in the project, that are located outside the project-tree ?
Can you start C::B with "-d"-switch ?
In the "Code::Blocks Debug" log you can see the projects base path and the projects common toplevel path.
With files that are not below the base-path it can happen, that the toplevel path is (e.g.) the root folder, in that case the parser probably parses tons of unneeded files.

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #10 on: April 11, 2012, 09:32:38 am »
Yes, I have some files in a dirs, that are outside of projects base path, for example, I have some Common files (common for all projects of all architectures, I working with, as f.e. type defines, and Common only for wxWidgets, for example, classed to work with sockets, and so on ) but they are all needed in that project. And in that project I did added only those files, that are really needed for it.
CB does not hangs on such files, but on one file, which is located in a projects base path, but is included from one of such "common" file in a path outside of the projects base path and has no .cpp file with the same name.

But I though that the parser parses only files in Project (and the includes in a include dirs list), and not all files, which are just near of that in a dir.

As I already said, I'll play with it a little bit, and try to define the state of configuration, when it occurs. But one I already know, it stops to hang, if there is a .cpp file in a project, with the same name but completely empty.
On "hang" I mean, that CB stops reacting for about 3-4 seconds, and then continue to work.

Offline MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #11 on: April 28, 2012, 09:32:23 am »
Hello CB Team.
The issue is still there.
If in a project there is a header file, and there is no corresponding .cpp file, when I navigate to that file (open it via doubleclick in a project tree, or through pressing Alt-Left), CB hangs for about 4-15 seconds. 15 seconds it hangs, if the file opened first time after opening the project. After that it hangs for about 4 seconds.
The .h file can be in a projects tree, or outside of it (I have two projects, which are using some common files).
If I add the corresponding file to the project, but do not put any code in it, only comments (file header), then it works normal.
If you like I can send a project, where it behaves in such a way.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Hanging for a while if no souce file, only header file
« Reply #12 on: April 28, 2012, 11:59:10 am »
If you like I can send a project, where it behaves in such a way.
I guess you have to, including exact steps to reproduce, because I don't have such issues.
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 MasterAlexei

  • Multiple posting newcomer
  • *
  • Posts: 83
    • Fun electronic
Re: Hanging for a while if no souce file, only header file
« Reply #13 on: April 28, 2012, 12:43:58 pm »
Ok. Since here is a restriction to 128 KB, here is the link:
http://masteralexei.homelinux.net/HomeCommunicator.7z (may be down some times for about 20 minutes, IP is dynamic there)

The interesting on it all is that, as I move the whole dirs into another place, it starts to work properly, without any delays and so on.

This project on my machine is located at D:\MyProjects\wxWidgets\HomeCommunicator\
I did make a copy of that to D:\Temp\HomeCommunicator and it work fine now.

It must be mentioned, that in a D:\MyProjects\ there are some more projects ( about 50-70 ) but, of course, in cbp project only the needed files are included.

So, the problem files are:
HCProtocol\ProtocolModel\Code\DataItemTypes.h
HCServer\MessageDefines.h
HCClient\MessageDefines.h

To reproduce - just open that files in a project in CB.
Or, open other file, then one of this.
And, if I add an empty .cpp file with the same name, as the .h files above in the same dir, it starts to work properly.