From: John L. <jr...@us...> - 2006-09-06 22:23:26
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14464/wxLua/modules/wxluasocket/include Modified Files: dservice.h wxldserv.h wxldtarg.h wxlsock.h Log Message: more code refactoring, move more functions into wxLuaDebuggerBase Index: wxldserv.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldserv.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxldserv.h 6 Sep 2006 05:33:08 -0000 1.10 --- wxldserv.h 6 Sep 2006 22:23:20 -0000 1.11 *************** *** 119,136 **** virtual ~wxLuaDebuggerBase() {} ! virtual bool AddBreakPoint(const wxString &fileName, int lineNumber) = 0; ! virtual bool RemoveBreakPoint(const wxString &fileName, int lineNumber) = 0; ! virtual bool ClearAllBreakPoints() = 0; ! virtual bool Run(const wxString &fileName, const wxString &buffer) = 0; ! virtual bool Step() = 0; ! virtual bool StepOver() = 0; ! virtual bool StepOut() = 0; ! virtual bool Continue() = 0; ! virtual bool Break() = 0; ! virtual bool Reset() = 0; ! virtual bool EnumerateStack() = 0; ! virtual bool EnumerateStackEntry(int stackEntry) = 0; ! virtual bool EnumerateTable(int tableRef, int nIndex, long nItemNode) = 0; ! virtual bool CleanupDebugReferences() = 0; private: --- 119,147 ---- virtual ~wxLuaDebuggerBase() {} ! virtual bool AddBreakPoint(const wxString &fileName, int lineNumber); ! virtual bool RemoveBreakPoint(const wxString &fileName, int lineNumber); ! virtual bool DisableBreakPoint(const wxString &fileName, int lineNumber); ! virtual bool EnableBreakPoint(const wxString &fileName, int lineNumber); ! virtual bool ClearAllBreakPoints(); ! virtual bool Run(const wxString &fileName, const wxString &buffer); ! virtual bool Step(); ! virtual bool StepOver(); ! virtual bool StepOut(); ! virtual bool Continue(); ! virtual bool Break(); ! virtual bool Reset(); ! virtual bool EnumerateStack(); ! virtual bool EnumerateStackEntry(int stackEntry); ! virtual bool EnumerateTable(int tableRef, int nIndex, long nItemNode); ! virtual bool CleanupDebugReferences(); ! virtual bool EvaluateExpr(int exprRef, const wxString &strExpression); ! ! virtual bool Compile(const wxString &fileName, const wxString &buffer); ! ! virtual void NotifyError(const wxString &msg); ! ! virtual int HandleDebugEvent(wxLuaDebugEvents_Type event_type); ! ! virtual wxLuaSocketBase* GetSocketBase() { return NULL; } private: *************** *** 163,187 **** bool WaitForConnect(int timeOut); - bool AddBreakPoint(const wxString &fileName, int lineNumber); - bool RemoveBreakPoint(const wxString &fileName, int lineNumber); - bool ClearAllBreakPoints(); - bool Run(const wxString &fileName, const wxString &buffer); - bool Step(); - bool StepOver(); - bool StepOut(); - bool Continue(); - bool Break(); - bool Reset(); - bool EnumerateStack(); - bool EnumerateStackEntry(int stackEntry); - bool EnumerateTable(int tableRef, int nIndex, long nItemNode); - bool CleanupDebugReferences(); void ThreadFunction(); - #if wxCHECK_VERSION(2, 3, 0) bool DisplayStackDialog(wxWindow *pParent); - #endif - bool EvaluateExpr(int exprRef, const wxString &pExpression); ! static bool Compile(const wxString &fileName, const wxString &buffer); protected: --- 174,181 ---- bool WaitForConnect(int timeOut); void ThreadFunction(); bool DisplayStackDialog(wxWindow *pParent); ! virtual wxLuaSocketBase* GetSocketBase() { return m_acceptedSocket; } protected: *************** *** 199,204 **** private: - static void NotifyError(const wxString &msg); - static int LuaCompileError (lua_State *L); DECLARE_ABSTRACT_CLASS(wxLuaDebugServer) }; --- 193,196 ---- Index: wxlsock.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxlsock.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxlsock.h 6 Sep 2006 05:33:08 -0000 1.7 --- wxlsock.h 6 Sep 2006 22:23:20 -0000 1.8 *************** *** 53,56 **** --- 53,59 ---- virtual ~wxLuaSocketBase() {} + // Is the socket currently connected + virtual bool IsConnected() = 0; + // Read the whole buffer of size length into buffer buffer from the socket virtual int Read(char *buffer, int length) = 0; *************** *** 142,147 **** int GetSocket() const { return m_sock; } // Test if the socket is readable ! bool IsReadable () const { return ((m_sockstate == SOCKET_CONNECTED) || --- 145,153 ---- int GetSocket() const { return m_sock; } + // Is the socket connected + virtual bool IsConnected() { return (m_sockstate == SOCKET_CONNECTED); } + // Test if the socket is readable ! bool IsReadable() const { return ((m_sockstate == SOCKET_CONNECTED) || *************** *** 150,154 **** // Test if the socket is writeable ! bool IsWritable () const { return ((m_sockstate != SOCKET_CONNECTED) || --- 156,160 ---- // Test if the socket is writeable ! bool IsWritable() const { return ((m_sockstate != SOCKET_CONNECTED) || Index: wxldtarg.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldtarg.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wxldtarg.h 6 Sep 2006 05:33:08 -0000 1.12 --- wxldtarg.h 6 Sep 2006 22:23:20 -0000 1.13 *************** *** 75,93 **** }; - class BreakPointObject : public wxObject - { - public: - BreakPointObject(const wxString &fileName, - int lineNumber) - : m_fileName(fileName), m_lineNumber(lineNumber) {} - - const wxString &GetFileName() const { return m_fileName; } - int GetLineNumber() const { return m_lineNumber; } - - private: - wxString m_fileName; - int m_lineNumber; - }; - public: --- 75,78 ---- Index: dservice.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/dservice.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dservice.h 6 Sep 2006 05:33:08 -0000 1.13 --- dservice.h 6 Sep 2006 22:23:19 -0000 1.14 *************** *** 73,77 **** bool Error() { return !m_socket || m_socket->Error(); } // Is Socket Connected, from wxSocketBase ! bool IsConnected() { return m_socket && m_socket->IsConnected(); } // Is Socket Connected, from wxSocketBase bool WaitForRead(long seconds = 0, long milliseconds = 300) { return m_socket && m_socket->WaitForRead(seconds, milliseconds); } --- 73,77 ---- bool Error() { return !m_socket || m_socket->Error(); } // Is Socket Connected, from wxSocketBase ! virtual bool IsConnected() { return m_socket && m_socket->IsConnected(); } // Is Socket Connected, from wxSocketBase bool WaitForRead(long seconds = 0, long milliseconds = 300) { return m_socket && m_socket->WaitForRead(seconds, milliseconds); } *************** *** 120,128 **** static wxString GetBreakPointKey(const wxFileName& fileName, int line) { - #if wxCHECK_VERSION(2,3,0) return wxString::Format(wxT("%u:%s"), line, fileName.GetFullPath().c_str()); - #else - return wxString::Format(wxT("%u:%s"), line, fileName.c_str()); - #endif } --- 120,124 ---- *************** *** 290,313 **** bool Connect(const wxString& hostname = wxT("localhost"), int portNumber = WXLUA_SOCKET_PORT); ! // Debugger Commands ! bool AddBreakPoint(const wxString &fileName, int lineNumber); ! bool RemoveBreakPoint(const wxString &fileName, int lineNumber); ! bool DisableBreakPoint(const wxString &fileName, int lineNumber); ! bool EnableBreakPoint(const wxString &fileName, int lineNumber); ! bool ClearAllBreakPoints(); ! bool Step(); ! bool StepOver(); ! bool StepOut(); ! bool Continue(); ! bool Break(); ! bool EnumerateStack(); ! bool Reset(); ! bool EnumerateStackEntry(int stackEntry); ! bool EnumerateTable(int tableRef, int nIndex, long nItemNode); ! bool CleanupDebugReferences(); protected: void OnSocketEvent(wxSocketEvent& event); - void NotifyError(const wxString &msg); // Not Required for Debug Service --- 286,293 ---- bool Connect(const wxString& hostname = wxT("localhost"), int portNumber = WXLUA_SOCKET_PORT); ! virtual wxLuaSocketBase* GetSocketBase() { return m_debuggerSocket; } protected: void OnSocketEvent(wxSocketEvent& event); // Not Required for Debug Service *************** *** 318,322 **** mutable wxCriticalSection m_debuggerSocketCriticalSection; wxLuaDebugSocket* m_debuggerSocket; - int m_portNumber; DECLARE_EVENT_TABLE() --- 298,301 ---- |