Author Topic: bug in project open  (Read 5722 times)

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
bug in project open
« on: November 03, 2009, 09:45:44 pm »
Hello everybody,

I'm not sure if this is a bug, maybe I'm just understanding this wrong.

When I open a project in c::b which had some files open in the editor the last time it was closed, then c::b first opens these files firing a cbEVT_EDITOR_OPEN event for every opened file. A moment after that c::b fires a cbEVT_PROJECT_OPEN event. Shouldn't it be the other way around? I mean: shouldn't the cbEVT_PROJECT_OPEN event be the first event and the cbEVT_EDITOR_OPEN events follow?

The way it is now I can catch the cbEVT_EDITOR_OPEN event, I can retrieve the associated cbEditor, from the cbEditor I can retrieve the ProjectFile. But from that ProjectFile I can't retrieve its cbProject with GetParentProject(). It just returns NULL it seems. If this is right, it doesn't make much sense, since the files, open or not in an editor, are still the files of a project ...

Perhaps I'm wrong all the way ...  :roll:

Regards

nausea
« Last Edit: November 07, 2009, 05:46:48 pm by nausea »
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: bug in project open
« Reply #1 on: November 06, 2009, 08:56:25 pm »
Well, I sure hope that the code completion and the debugger threads fill find an answer soon  :D

It seems everybody is much more engaged in those two discussions (and with all the right in the world) than in everything else ... as till now I didn't even get a reply to my post, not even a reply telling me that my post was bull... or something, just plain nothing  :wink:

This isn't a complaint, nor am I angry in any way, CC y debugger are indeed much more important.

Regards and many thanks for all the work and brains the developers spend in this project

greetings from asturias

nausea
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: bug in project open
« Reply #2 on: November 06, 2009, 10:09:10 pm »
Well, I sure hope that the code completion and the debugger threads fill find an answer soon  :D
What version do you use? And can you provide me with a sample code (e.g. of a tiny plugin) 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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: bug in project open
« Reply #3 on: November 07, 2009, 08:59:07 am »
@morten:

Setting a breakpoint in both event handler can test this.

about event sequence, there is another bug:

http://forums.codeblocks.org/index.php/topic,10813.msg77915.html#msg77915
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 frithjofh

  • Regular
  • ***
  • Posts: 376
Re: bug in project open
« Reply #4 on: November 07, 2009, 05:56:47 pm »
Hi and thanks for the replies,

I use svn build rev 5867 (2009-10-20T08:34_02.643399Z) gcc4.3.2 Linux/unicode of code::blocks, machine and OS see below.

I found this behavior from inside the todo plug in. I just checked when the events come in in different scenarios. The editor open events always come in before the project open event and trying to retrieve the project from one of the open editor events results in an uninitialized pointer. I don't think that the fault lies within this plug in, but somewhere within c::b dispatching the events.

Maybe it is like that on purpose, I don't know, but it didn't seem very logical nor useful.

Regards

nausea
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100