From: John L. <jr...@us...> - 2006-09-07 22:42:23
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4262/wxLua/modules/wxluasocket/include Modified Files: dservice.h wxldserv.h wxldtarg.h wxlsock.h wxluasocket_bind.h Log Message: make wxLuaDebugData derived from wxObject and ref counted so we don't have to remember to delete it or check NULL make the wxTread in wxLuaDebugServer part of the class as wxLuaDebugTarget does Index: dservice.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/dservice.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dservice.h 6 Sep 2006 22:23:19 -0000 1.14 --- dservice.h 7 Sep 2006 22:42:19 -0000 1.15 *************** *** 239,245 **** bool NotifyError(const wxString &errorMsg); bool NotifyExit(); ! bool NotifyStackEnumeration(wxLuaDebugData *pDebugData); ! bool NotifyStackEntryEnumeration(int stackRef, wxLuaDebugData *pDebugData); ! bool NotifyTableEnumeration(long itemNode, wxLuaDebugData *pDebugData); bool NotifyEvaluateExpr(int exprRef, const wxString &strResult); bool NotifyBreakpointAdded(wxLuaBreakPoint& breakPoint, wxLuaDebugSocket* debugSocket = NULL); --- 239,245 ---- bool NotifyError(const wxString &errorMsg); bool NotifyExit(); ! bool NotifyStackEnumeration(const wxLuaDebugData& debugData); ! bool NotifyStackEntryEnumeration(int stackRef, const wxLuaDebugData& debugData); ! bool NotifyTableEnumeration(long itemNode, const wxLuaDebugData& debugData); bool NotifyEvaluateExpr(int exprRef, const wxString &strResult); bool NotifyBreakpointAdded(wxLuaBreakPoint& breakPoint, wxLuaDebugSocket* debugSocket = NULL); Index: wxlsock.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxlsock.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxlsock.h 7 Sep 2006 04:20:54 -0000 1.9 --- wxlsock.h 7 Sep 2006 22:42:19 -0000 1.10 *************** *** 70,74 **** unsigned long ReadULong(); wxString ReadString(); ! wxLuaDebugData *ReadDebugData(); // Write data to the socket, calls virtual void Write(...) --- 70,74 ---- unsigned long ReadULong(); wxString ReadString(); ! wxLuaDebugData ReadDebugData(); // Write data to the socket, calls virtual void Write(...) *************** *** 82,86 **** bool WriteULong(unsigned long value); bool WriteString(const wxString &value); ! bool WriteDebugData(const wxLuaDebugData *pData); }; --- 82,86 ---- bool WriteULong(unsigned long value); bool WriteString(const wxString &value); ! bool WriteDebugData(const wxLuaDebugData& debugData); }; Index: wxluasocket_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxluasocket_bind.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxluasocket_bind.h 28 Aug 2006 05:26:21 -0000 1.4 --- wxluasocket_bind.h 7 Sep 2006 22:42:19 -0000 1.5 *************** *** 57,61 **** // ---------------------------------------------------------------------------- - extern WXDLLIMPEXP_DATA_WXLUASOCKET(int) s_wxluatag_wxLuaDebugData; extern WXDLLIMPEXP_DATA_WXLUASOCKET(int) s_wxluatag_wxLuaDebugEvent; extern WXDLLIMPEXP_DATA_WXLUASOCKET(int) s_wxluatag_wxLuaDebugServer; --- 57,60 ---- *************** *** 67,72 **** // ---------------------------------------------------------------------------- - extern WXDLLIMPEXP_WXLUASOCKET WXLUAMETHOD* wxLuaDebugData_methods; - extern WXDLLIMPEXP_DATA_WXLUASOCKET(int) wxLuaDebugData_methodCount; extern WXDLLIMPEXP_WXLUASOCKET WXLUAMETHOD* wxLuaDebugEvent_methods; extern WXDLLIMPEXP_DATA_WXLUASOCKET(int) wxLuaDebugEvent_methodCount; --- 66,69 ---- Index: wxldtarg.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldtarg.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wxldtarg.h 6 Sep 2006 22:23:20 -0000 1.13 --- wxldtarg.h 7 Sep 2006 22:42:19 -0000 1.14 *************** *** 55,60 **** class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugTarget : public wxObject { ! private: ! class LuaThread : public wxThread { --- 55,62 ---- class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugTarget : public wxObject { ! protected: ! // ----------------------------------------------------------------------- ! // wxLuaDebugTarget::LuaThread - a wxThread for the wxLuaDebugTarget ! // ----------------------------------------------------------------------- class LuaThread : public wxThread { *************** *** 62,84 **** LuaThread(wxLuaDebugTarget *pTarget) : wxThread(wxTHREAD_JOINABLE), m_pTarget(pTarget) {} - bool TestDestroy(); - - protected: - // thread execution starts here - virtual void *Entry(); - // called when the thread exits - virtual void OnExit(); - - private: wxLuaDebugTarget *m_pTarget; }; public: ! ! wxLuaDebugTarget(const wxLuaState& wxlState, ! const wxString &serverName, ! int portNumber); ! virtual ~wxLuaDebugTarget(); --- 64,77 ---- LuaThread(wxLuaDebugTarget *pTarget) : wxThread(wxTHREAD_JOINABLE), m_pTarget(pTarget) {} + protected: + virtual void *Entry(); // thread execution starts here + virtual void OnExit() {} // called when the thread exits wxLuaDebugTarget *m_pTarget; }; public: ! wxLuaDebugTarget(const wxLuaState& wxlState, const wxString &serverName, ! int portNumber); virtual ~wxLuaDebugTarget(); *************** *** 103,109 **** wxString m_serverName; wxSortedArrayString m_breakPointList; - #if wxCHECK_VERSION(2, 3, 3) wxMutex m_debugMutex; - #endif wxCondition m_debugCondition; wxLuaSocket m_clientSocket; --- 96,100 ---- *************** *** 116,122 **** bool m_fErrorsSeen; int m_nFramesUntilBreak; - #if wxCHECK_VERSION(2, 3, 3) wxMutex m_runMutex; - #endif wxCondition m_runCondition; wxLuaBufferArray m_bufferList; --- 107,111 ---- *************** *** 147,153 **** bool NotifyError(const wxString &errorMsg); bool NotifyExit(); ! bool NotifyStackEnumeration(wxLuaDebugData *pDebugData); ! bool NotifyStackEntryEnumeration(int stackRef, wxLuaDebugData *pDebugData); ! bool NotifyTableEnumeration(long itemNode, wxLuaDebugData *pDebugData); bool NotifyEvaluateExpr(int exprRef, const wxString &strResult); --- 136,142 ---- bool NotifyError(const wxString &errorMsg); bool NotifyExit(); ! bool NotifyStackEnumeration(const wxLuaDebugData& debugData); ! bool NotifyStackEntryEnumeration(int stackRef, const wxLuaDebugData& debugData); ! bool NotifyTableEnumeration(long itemNode, const wxLuaDebugData& debugData); bool NotifyEvaluateExpr(int exprRef, const wxString &strResult); Index: wxldserv.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldserv.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wxldserv.h 6 Sep 2006 22:23:20 -0000 1.11 --- wxldserv.h 7 Sep 2006 22:42:19 -0000 1.12 *************** *** 76,83 **** virtual ~wxLuaDebugServerInterface(); ! virtual wxLuaDebugData *EnumerateStack(); ! virtual wxLuaDebugData *EnumerateStackEntry(int nEntry); ! virtual wxLuaDebugData *EnumerateTable(int nRef, int nEntry, long data = 0); ! virtual wxLuaDebugData *GetGlobalData(); virtual bool IsDebugServer() const { return true; } --- 76,83 ---- virtual ~wxLuaDebugServerInterface(); ! virtual wxLuaDebugData EnumerateStack(); ! virtual wxLuaDebugData EnumerateStackEntry(int nEntry); ! virtual wxLuaDebugData EnumerateTable(int nRef, int nEntry, long data = 0); ! virtual wxLuaDebugData GetGlobalData(); virtual bool IsDebugServer() const { return true; } *************** *** 88,113 **** // ---------------------------------------------------------------------------- - // wxLuaDebugServerThread - a wxThread for the wxLuaDebugServer - // ---------------------------------------------------------------------------- - - class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugServerThread : public wxThread - { - public: - wxLuaDebugServerThread(wxLuaDebugServer *pServer) : wxThread(wxTHREAD_JOINABLE) - { - m_pServer = pServer; - } - - protected: - // thread execution starts here - virtual void *Entry(); - // called when the thread exits - virtual void OnExit() {} - - private: - wxLuaDebugServer *m_pServer; - }; - - // ---------------------------------------------------------------------------- // wxLuaDebuggerBase - Debugger interface base class // ---------------------------------------------------------------------------- --- 88,91 ---- *************** *** 155,161 **** class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugServer : public wxLuaDebuggerBase ! { ! public: wxLuaDebugServer(int portNumber); virtual ~wxLuaDebugServer(); --- 133,154 ---- class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugServer : public wxLuaDebuggerBase ! { ! protected: ! // ---------------------------------------------------------------------------- ! // wxLuaDebugServer::LuaThread - a wxThread for the wxLuaDebugServer ! // ---------------------------------------------------------------------------- ! class LuaThread : public wxThread ! { ! public: ! LuaThread(wxLuaDebugServer *pServer) : wxThread(wxTHREAD_JOINABLE), ! m_pServer(pServer) {} ! protected: ! virtual void *Entry(); // thread execution starts here ! virtual void OnExit() {} // called when the thread exits + wxLuaDebugServer *m_pServer; + }; + + public: wxLuaDebugServer(int portNumber); virtual ~wxLuaDebugServer(); *************** *** 180,191 **** protected: ! wxLuaSocket *m_serverSocket; ! wxLuaSocket *m_acceptedSocket; ! int m_processID; ! int m_portNumber; ! wxProcess *m_pProcess; ! wxLuaDebugServerThread *m_pThread; ! wxLuaStackDialog *m_pStackDialog; ! bool m_fShutdown; static wxString sm_programName; --- 173,184 ---- protected: ! wxLuaSocket *m_serverSocket; ! wxLuaSocket *m_acceptedSocket; ! int m_processID; ! int m_portNumber; ! wxProcess *m_pProcess; ! LuaThread *m_pThread; ! wxLuaStackDialog *m_pStackDialog; ! bool m_fShutdown; static wxString sm_programName; *************** *** 212,216 **** void SetMessage(const wxString &message); ! void SetDebugData(long nReference, wxLuaDebugData *pDebugData = NULL); int GetLineNumber() const { return m_lineNumber;} --- 205,209 ---- void SetMessage(const wxString &message); ! void SetDebugData(long nReference, const wxLuaDebugData& pDebugData = wxLuaDebugData()); int GetLineNumber() const { return m_lineNumber;} *************** *** 219,223 **** int GetReference() const { return m_nReference; } bool GetEnabledFlag() const { return m_fEnabledFlag; } ! const wxLuaDebugData *GetDebugData() const { return m_pDebugData; } protected: --- 212,216 ---- int GetReference() const { return m_nReference; } bool GetEnabledFlag() const { return m_fEnabledFlag; } ! wxLuaDebugData GetDebugData() const { return m_debugData; } protected: *************** *** 230,234 **** long m_nReference; bool m_fEnabledFlag; ! wxLuaDebugData *m_pDebugData; private: --- 223,227 ---- long m_nReference; bool m_fEnabledFlag; ! wxLuaDebugData m_debugData; private: |