Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Attention massive speed up of the debugger
Jenna:
With your change we can get multiple lines of output, that have to be split into an array to work correctly in any cases as discussed before.
This will take some time (not really much, but that depeon the system's load and speed).
Then we loop through the array and send it to ParseOutput.
While this happens it might be that we reach another EVT_PIPEDPROCESS_STDOUT, EVT_PIPEDPROCESS_STDERR or EVT_TIMER, because the debugger process runs asynchronously, the timer should do this also of course.
So it might happen, that we are just parsing a large amount of output, while we get another event with content to parse, or am I missing something.
oBFusCATed:
Jens can you provide some link documenting this kind of behaviour (I'm not an wx expert (not even wx advanced guy), most of the GUI code I've done is in MFC/win32 api),
I think we can't get a EVT_PIPEDPROCESS_STDOUT, EVT_PIPEDPROCESS_STDERR or EVT_TIMER,
While we are in a handler of some of them (ParseOutput is called only from handlers of these three messages).
Also: Can you test this patch: http://smrt.is-a-geek.org/codeblocks/dbg_speedup_test.patch
It does the splitting of the output,
logging to file ( change /home/obfuscated/cb.log to some path on your machine),
sends the non '\n' terminated output in the OnTimer handler.
If you have problems can you send me the result log file?
Also you could revert the changes in the DebuggerGDB::ParseOutput, rerun the debug session and send me the output file.
Jenna:
No, I do not have any documentation about that (except for the wxwidgets docu).
It's just a question.
If it is sure, that we cannot get one of the events while we are processing one of them, there is no problem using this (splitting the messages in debuggergdb's ParseOutput and call the drivers ParseOutput for each line).
No problems here (until now) but I do not have much time for testing on windows at the moment.
oBFusCATed:
--- Quote from: jens on December 02, 2009, 11:06:37 am ---No, I do not have any documentation about that (except for the wxwidgets docu).
It's just a question.
If it is sure, that we cannot get one of the events while we are processing one of them, there is no problem using this (splitting the messages in debuggergdb's ParseOutput and call the drivers ParseOutput for each line).
--- End quote ---
It can happen if someone does wxMesssageBox() or shows another modal dialog.
I've tested it with two timers. I don't know if there aren't any other cases where you can send/receive events from the queue inside a handler of another event? In win32 API you could do:
--- Code: --- MSG msg;
while(PeekMessage(&msg, windowHandle, 0, 0, PM_REMOVE /*| PM_QS_PAINT*/) == TRUE)
{
TranslateMessage (&msg);
DispatchMessage(&msg);
}
--- End code ---
to pop all messages from the queue.
Is there wx equivalent for this piece of code?
I'm thinking of a strategy how to fix this problem, but I don't have much time/energy at the moment :(
--- Quote from: jens on December 02, 2009, 11:06:37 am ---No problems here (until now) but I do not have much time for testing on windows at the moment.
--- End quote ---
Are you talking about the last patch?
oBFusCATed:
What about this kind of solution:
--- Code: ---/// in the class declaration
private:
std::deque<wxString> m_lines;
wxString m_timer1, m_timer2;
bool m_in_handler;
/// in the cpp file
void wx_timerDialog::OnTimer(wxTimerEvent& event)
{
m_timer1 = Common(m_timer1 + "t1_line1\nt1_line2\nt1_line3\n");
}
void wx_timerDialog::OnTimer2(wxTimerEvent& event)
{
m_timer2 = Common(m_timer2 + "t2_line1\nt2_line2\n=t2_line3\n");
}
wxString wx_timerDialog::CommonFunc(wxString const &output)
{
if(m_in_handler)
{
int start = 0;
while(1)
{
wxString::size_type pos = output.find('\n', start);
if(pos != wxString::npos)
{
m_lines.push_back(output.substr(start, pos - start));
start = pos + 1;
}
else
break;
}
if(start < output.length())
{
return output.substr(start, output.length() - start);
}
}
else
{
m_in_handler = true;
while(!m_lines.empty())
{
wxString const &s = m_lines.front();
/// do some processing
m_lines.pop_front();
}
m_in_handler = false;
}
}
--- End code ---
Any comments and suggestions are welcome.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version