From: John L. <jr...@us...> - 2006-10-04 22:07:27
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29706/wxLua/modules/wxluasocket/include Modified Files: dservice.h wxldserv.h Log Message: check return values of debuger server to exit more gracefully on failure move port number into wxLuaDebuggerBase Index: wxldserv.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldserv.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wxldserv.h 4 Oct 2006 05:55:02 -0000 1.21 --- wxldserv.h 4 Oct 2006 22:07:23 -0000 1.22 *************** *** 137,143 **** { public: ! wxLuaDebuggerBase(); virtual ~wxLuaDebuggerBase(); // These functions all send socket commands wxLUASOCKET_DEBUGGER_CMD_XXX // and the appropriate data to the debuggee. --- 137,151 ---- { public: ! wxLuaDebuggerBase(int port_number); virtual ~wxLuaDebuggerBase(); + // Start the debugger server to listen for a debuggee. After creation + // you must call StartServer to actually start the server. + virtual bool StartServer() = 0; + // Stop the debugger server + virtual bool StopServer() = 0; + // Start a debuggee client to be debugged by this + virtual bool StartClient() = 0; + // These functions all send socket commands wxLUASOCKET_DEBUGGER_CMD_XXX // and the appropriate data to the debuggee. *************** *** 191,194 **** --- 199,205 ---- void OnEndDebugeeProcess(wxProcessEvent& event); + // Get the port number the socket is using + int GetPortNumber() const { return m_port_number; } + // Set the program name to start the debuggee target with // Note: If the the program name is empty when this class is created, it *************** *** 206,209 **** --- 217,221 ---- protected: + int m_port_number; // the socket port to listen to wxLuaStackDialog *m_stackDialog; wxProcess *m_debuggeeProcess; // wxProcess of the debuggee *************** *** 245,249 **** public: ! wxLuaDebuggerServer(int portNumber); virtual ~wxLuaDebuggerServer(); --- 257,261 ---- public: ! wxLuaDebuggerServer(int port_number); virtual ~wxLuaDebuggerServer(); *************** *** 251,257 **** bool StopServer(); bool StartClient(); bool StartServerThread(); bool WaitForConnect(int timeOut); - void ThreadFunction(); --- 263,269 ---- bool StopServer(); bool StartClient(); + bool StartServerThread(); bool WaitForConnect(int timeOut); void ThreadFunction(); *************** *** 261,265 **** wxLuaSocket *m_serverSocket; wxLuaSocket *m_acceptedSocket; - int m_portNumber; wxLuaDebuggerServer::LuaThread *m_pThread; bool m_fShutdown; --- 273,276 ---- *************** *** 281,285 **** { public: ! wxLuaDebuggerwxSocketServer(int portNumber); virtual ~wxLuaDebuggerwxSocketServer(); --- 292,296 ---- { public: ! wxLuaDebuggerwxSocketServer(int port_number); virtual ~wxLuaDebuggerwxSocketServer(); *************** *** 287,291 **** bool StopServer(); bool StartClient(); - bool StartServerThread() { return true; } virtual wxLuaSocketBase* GetSocketBase() { return m_acceptedSocket; } --- 298,301 ---- *************** *** 299,303 **** wxSocketServer *m_serverSocket; wxLuaDebugSocket *m_acceptedSocket; - int m_portNumber; private: --- 309,312 ---- Index: dservice.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/dservice.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** dservice.h 4 Oct 2006 05:55:02 -0000 1.19 --- dservice.h 4 Oct 2006 22:07:23 -0000 1.20 *************** *** 14,17 **** --- 14,31 ---- // wxWidgets Socket Sample + // Ray Gilbert moved class definitions out of wxLuaDebuggerServer, wxLuaDebugIO + // to allow alternate debugger model + // + // Original Debugging Model: + // wxLuaDebuggerServer, wxLuaDebugTarget + // The current process acts as a server - debugger (wxLuaDebuggerServer) + // starts a new process which starts up as a client - debuggee (wxLuaDebugTarget) + // that connects back to server process. + // + // Alternative Debugging Model: + // wxLuaDebugService, wxLuaDebuggee, wxLuaDebugger + // The current process acts as a server - debuggee (wxLuaDebugService; wxLuaDebuggee). + // This service waits for client - debugger to connect. + #ifndef WX_LUA_DEBUGGERSERVICE_H #define WX_LUA_DEBUGGERSERVICE_H *************** *** 269,273 **** { public: ! wxLuaDebugger(); virtual ~wxLuaDebugger(); --- 283,287 ---- { public: ! wxLuaDebugger(int port_number = WXLUA_SOCKET_PORT); virtual ~wxLuaDebugger(); |