On 12/11/06, Andre <[EMAIL PROTECTED]> wrote:
> When this code is invoke on an error
>
> the call m_debugger->OnEndDebugeeProcess(event);
> seems to destroy both m_debugger and the running wxLuaDebuggerProcess
>
>
> void wxLuaDebuggerProcess::OnTerminate(int pid, int status)
> {
> // If this is being deleted from the destructor of wxLuaDebuggerBase
> // it has already been NULLed so don't send event or delete this.
> if (m_debugger->m_debuggeeProcess)
> {
> // we don't use the event handler, but this is good enough.
> wxProcessEvent event(m_id, pid, status);
> m_debugger->OnEndDebugeeProcess(event);
>
> m_debugger->m_debuggeeProcess = NULL;
> m_debugger->m_debuggeeProcessID = -1;
> delete this;
> }
> }
>
> it seem to work fine if the last 3 lines are removed:
>
> m_debugger->m_debuggeeProcess = NULL;
> m_debugger->m_debuggeeProcessID = -1;
> delete this;
But then you have zombie debugee processes if something fails. I
worked on this last night a little bit and hope it's better now. The
problem is that you want to Kill debuggee process, but when you do the
main thread is run and if you're in the destructor of the
wxLuaDebuggerBase things get out of sync and you get an exception. It
seems as though what you want to do is
1) kill debugee process in the debugger server
2) send some made up event back to myself so that the wxWidgets event
handler is run at least once
3) in the event handler actually delete the debugger server
I have to debug it more, but you may want to look at the current cvs
to see what I've done. See ~wxLuaDebuggerBase and the OnTerminate you
mention. Another idea is to create a static class to actually delete
the process so that when the Kill function returns the class will
still be there.
This crashes because KillDebuggee returns, but the process is still in
a thread trying to kill it when you delete the debugger server.
debuggerServer:KillDebuggee()
debuggerServer:Delete()
Does this make sense? The backtrace that MS Visual Studio gives is
pretty bad, but a breakpoint set in the debugger server shows that the
problem seems to be with that.
John Labenski
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users