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

CC plugin interface redesign

Started by Alpha, July 03, 2013, 03:23:16 PM

Previous topic - Next topic

Alpha

My data seems to conflict with itself.  Using wxStopWatch, pass by reference is on average 1366.13 ms, and return value is 1423.27 ms.  However, the when I measured just the cost of creating a copy, wxStopWatch mostly reported 1 ms, implying the two techniques have no appreciable difference.

oBFusCATed

Probably RVO or NVRO optimizations are kicking in...
(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!]

Alpha

Moving
void CodeCompletion::OnAutocompleteSelect(wxListEvent& event)
from CC to CCManager causes a crash whenever timer.Start() is called from within it.  I have tried for several hours to find a cause and am out of ideas to try; thoughts?

oBFusCATed

Have you tried running C::B with valgrind?  ::)
(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!]

Jenna

Quote from: Alpha on October 05, 2013, 03:20:56 AM
Moving
void CodeCompletion::OnAutocompleteSelect(wxListEvent& event)
from CC to CCManager causes a crash whenever timer.Start() is called from within it.  I have tried for several hours to find a cause and am out of ideas to try; thoughts?
Can you provide a patch, where the crash occurs, so I can try to debug it.

Alpha

Quote from: oBFusCATed on October 05, 2013, 11:02:58 AM
Have you tried running C::B with valgrind?  ::)
Not tried valgrind yet, but I will now.

Quote from: jens on October 05, 2013, 11:11:56 AM
Can you provide a patch, where the crash occurs, so I can try to debug it.
Attached is the current state of my code; I could try to minimize the other changes if you would like (however, the crash happens before control reaches any other new code, so I did not bother currently).

Jenna

Against which revision, branch or fork is the patch ?

oBFusCATed

(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!]

Jenna

I already cloned alphas github repo, but there is no ccmanager.{h|cpp} inside it.

Alpha

Did you switch to the cc_interface branch?  The files should be there.

Alpha

Quote from: Alpha on October 05, 2013, 04:26:10 PM
Quote from: oBFusCATed on October 05, 2013, 11:02:58 AM
Have you tried running C::B with valgrind?  ::)
Not tried valgrind yet, but I will now.
Tested, and got something around 2700 messages.  I could not find any that had an obvious relation to this problem, though.

Jenna

Quote from: Alpha on October 05, 2013, 07:14:05 PM
Did you switch to the cc_interface branch?  The files should be there.
I have it now, thanks.

I will see if I can find anything this evening.

Jenna

You need to specify the eventsink in the Connect-function, otherwise the editor-control is used as eventsink, because you connect the event to it.
The correct function is called, but with an incorrect this-pointer and therefore the member variable that holds the timer also points to an incorrect location.
Instead of using the timer some undefined memory that belongs to the editor-control is used => crash.

Just add NULL, this to the parameter list of Connect (and Disconnect) in CCManager::OnEditorOpen ( and CCManager::OnEditorClose).
I'm not sure if it is really needed for Disconnect, but it does not hurd.

Alpha

Thank you!  Greatly appreciated.  (I cannot believe I missed that... in fact, I was so certain I had tried it, and just about everything else.  Maybe I was just coding too late at night :-\.)

Auto parenthesis after functions is now reimplemented.  The only major visible component left to complete is the documentation popup.

oBFusCATed

What about the symbol browser? Have it been separated from the CC plugin?
(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!]