News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

event sequence question?

Started by ollydbg, September 03, 2011, 02:44:49 PM

Previous topic - Next topic

ollydbg

By reading the CC's source, I'm totally confused about the events sent from the C::B core and the event sequences.

I'd like to see the official development document about all the C::B's event sending sequence and other official C::B event.

I remember several years ago, we have a discussion: Puzzling cbEVT_EDITOR_* event behavior

But that discussion does not show all the sequence, so are there any documents?

If I can remember, jens has a plugin to monitor all the event sent from the core, so is it possible share/add this plugin to the contributed plugin achieve, so that we can learn more about C::B, and maybe it is much better for plugin developers.

Thanks.
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.

oBFusCATed

Quote from: ollydbg on September 03, 2011, 02:44:49 PM
But that discussion does not show all the sequence, so are there any documents?
No, of course, the source is the only documentation, because it is the most up to date resource
and it is too easy if there are docs, real programmers don't write docs and don't need docs :)  (the last one is me joking)
(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!]

MortenMacFly

Quote from: ollydbg on September 03, 2011, 02:44:49 PM
If I can remember, jens has a plugin to monitor all the event sent from the core, so is it possible share/add this plugin to the contributed plugin achieve, so that we can learn more about C::B, and maybe it is much better for plugin developers.
There are two of this plugins - Jens's was called EventsDisplay (IIRC). However, adding this to trunk makes no sense as it would seriously spoil down C::B in terms of performance and stability. Just search the forums (it should be still there) and compile it yourself... it's a pretty simple plugin in the end. (However, I doubt it is still up-to-date...?!)
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 September 05, 2011, 07:25:07 AM
Quote from: ollydbg on September 03, 2011, 02:44:49 PM
If I can remember, jens has a plugin to monitor all the event sent from the core, so is it possible share/add this plugin to the contributed plugin achieve, so that we can learn more about C::B, and maybe it is much better for plugin developers.
There are two of this plugins - Jens's was called EventsDisplay (IIRC). However, adding this to trunk makes no sense as it would seriously spoil down C::B in terms of performance and stability. Just search the forums (it should be still there) and compile it yourself... it's a pretty simple plugin in the end. (However, I doubt it is still up-to-date...?!)
I just updated it, and will upload it to my server.
It might also be added to the plugins (not contrib), just like the headerguard-plugin for example, without being included in automake-system and contrib-plugins workspace.

Jenna

Quote from: jens on September 05, 2011, 08:09:55 AM
I just updated it, and will upload it to my server.

Here it is:
http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
unpack it into src/plugins subdirectory of C::B's sources (not in contrib !!).
Don't forget to run src/update[.bat] afterwards, to copy the plugin from devel- to output-folder.

The Makefile.am is not tested, so it might or might not work after integrating it into automake-system.

ollydbg

Quote from: jens on September 05, 2011, 09:02:37 AM
Quote from: jens on September 05, 2011, 08:09:55 AM
I just updated it, and will upload it to my server.

Here it is:
http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
unpack it into src/plugins subdirectory of C::B's sources (not in contrib !!).
Don't forget to run src/update[.bat] afterwards, to copy the plugin from devel- to output-folder.

The Makefile.am is not tested, so it might or might not work after integrating it into automake-system.
Thank you for the sharing! I will try it now.
I currently work on Windows, so I don't need automake-system. :D
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.

ollydbg

#6
This plugin works fine on Windows.

I'm testing on the trunk code( I also remove the codecompletion.dll and debuger.dll when testing), the strange thing is after I recieved a cbEVT_EDITOR_TOOLTIP event, if I hit the ctrl key, then I do not receive the cbEVT_EDITOR_TOOLTIP_CANCEL event. This indicates that something we have done in debugger branch (change the scintilla related dwell code to filter the ctrl) should reconsidered. :D


BTW:
Please remove the *.so file in the package: http://apt.jenslody.de/downloads/DisplayEvents_0.3.7z
It is Linux only file.

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.

Jenna


ollydbg

Hi, Jens, this plugin (DisplayEvents plugin - CodeBlocks)has a build error when building against trunk code(rev9765).
Those three events do not exist in SDK, so they should be removed.

cbEVT_EDITOR_BREAKPOINT_ADD
cbEVT_EDITOR_BREAKPOINT_EDIT
cbEVT_EDITOR_BREAKPOINT_DELETE


Also, I just open a sample project (which created by a wx wizard), and I receive those logs, I don't know why there are so many cbEVT_EDITOR_ACTIVATED events. Before open the project, I have only C::B startup-home-page opened, after opening the project, two editors are opened.


21:24:23,250  =>  cbEVT_EDITOR_CLOSE
Loading project file...
Parsing project file...
21:24:23,296  =>  cbEVT_PROJECT_RENAMED
21:24:23,296  =>  cbEVT_BUILDTARGET_ADDED
21:24:23,296  =>  cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Debug
21:24:23,296  =>  cbEVT_BUILDTARGET_ADDED
21:24:23,296  =>  cbEVT_PROJECT_TARGETS_MODIFIED
Loading target Release
Loading project files...
21:24:23,296  =>  cbEVT_PROJECT_BEGIN_ADD_FILES
21:24:23,328  =>  cbEVT_PROJECT_END_ADD_FILES
6 files loaded
Done loading project in 78ms
Project's base path: E:\code\cb\test_code\wx3-hang\
Project's common toplevel path: E:\code\cb\test_code\wx3-hang\
21:24:23,359  =>  cbEVT_BUILDTARGET_SELECTED
21:24:23,359  =>  cbEVT_EDITOR_SWITCHED
21:24:23,359  =>  cbEVT_EDITOR_ACTIVATED
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Windows Chinese Simplified (CP 936) (ID: 28)
Conversion succeeded using wxCSConv (buffer size = 691, converted size = 692.
21:24:23,375  =>  cbEVT_EDITOR_OPEN
Project data set for E:\code\cb\test_code\wx3-hang\wx3_hangApp.cpp
21:24:23,375  =>  cbEVT_EDITOR_SWITCHED
21:24:23,375  =>  cbEVT_EDITOR_ACTIVATED
21:24:23,390  =>  cbEVT_EDITOR_DEACTIVATED
21:24:23,390  =>  cbEVT_EDITOR_SWITCHED
21:24:23,390  =>  cbEVT_EDITOR_ACTIVATED
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Windows Chinese Simplified (CP 936) (ID: 28)
Conversion succeeded using wxCSConv (buffer size = 465, converted size = 466.
21:24:23,406  =>  cbEVT_EDITOR_OPEN
Project data set for E:\code\cb\test_code\wx3-hang\wx3_hangApp.h
Top Editor: E:\code\cb\test_code\wx3-hang\wx3_hangApp.h
21:24:23,406  =>  cbEVT_EDITOR_SWITCHED
21:24:23,406  =>  cbEVT_EDITOR_ACTIVATED
21:24:23,421  =>  cbEVT_PROJECT_OPEN
21:24:23,421  =>  cbEVT_WORKSPACE_CHANGED
21:24:23,421  =>  cbEVT_PROJECT_ACTIVATE
21:24:23,484  =>  cbEVT_EDITOR_UPDATE_UI
21:24:24,500  =>  cbEVT_EDITOR_TOOLTIP
21:24:27,000  =>  cbEVT_EDITOR_TOOLTIP_CANCEL
21:24:28,218  =>  cbEVT_EDITOR_TOOLTIP
21:24:32,078  =>  cbEVT_EDITOR_TOOLTIP_CANCEL
21:24:33,250  =>  cbEVT_EDITOR_TOOLTIP
21:24:33,609  =>  cbEVT_EDITOR_TOOLTIP_CANCEL


Any one can help to explain why four cbEVT_EDITOR_ACTIVATED happens. The strange thing is this cbEVT_EDITOR_ACTIVATED is always following after cbEVT_EDITOR_SWITCHED event.

Especially, why there are two cbEVT_EDITOR_ACTIVATED events after

21:24:23,375  =>  cbEVT_EDITOR_OPEN
Project data set for E:\code\cb\test_code\wx3-hang\wx3_hangApp.cpp


PS: I'm hunting a CC deadlock bug...
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.

Quiss

Hi,

I added/updated project files, removed obsolete events and add new ones from sdk_events.h (svn11494). You can download from attachment.

Note: I tested only cbDisplayEvents_wx31_64.cbp and did NOT touch cbDisplayEvents-unix.cbp.

ollydbg

Hi, Quiss, many thanks.
Can you put those source code in a more "safe" place instead of an attachment of a forum post. I mean the attachment maybe cleaned up by forum administrators, maybe a good place is put the source in github.com or sourceforge.net, then post the link here. Thank you!
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.


ollydbg

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.

Miguel Gimenez

Should this plugin be added to the core plugins?. I think it can be very useful, not only for plugin developers but for core developers.

Quote from: jens on September 05, 2011, 08:09:55 AM
It might also be added to the plugins (not contrib), just like the headerguard-plugin for example, without being included in automake-system and contrib-plugins workspace.

AndrewCot

It would be very useful. IMHO Worst case add it as a contrib plugin, but I agree is would be better as a core plugin.