From: John L. <jr...@us...> - 2006-09-13 04:13:52
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv32141/wxLua/modules/wxluasocket/include Modified Files: dservice.h wxldserv.h wxldtarg.h wxlsock.h Log Message: Use GetCount not Count for wxArrays have wxLuaDebugData return the array as a pointer since it may not exist and add checks for it Rename wxLua socket enums so they start with wxLUASOCKET_XXX Removed wxLuaBuffer and just use wxArrayString instead Use wxInt32 wxUint32 for wxLuaSocket code not int, short, etc for 64 bit processors rework all wxLuaSocketBase::Read/Write code Index: wxldserv.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldserv.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wxldserv.h 7 Sep 2006 22:42:19 -0000 1.12 --- wxldserv.h 13 Sep 2006 04:13:47 -0000 1.13 *************** *** 24,67 **** // ---------------------------------------------------------------------------- ! // wxLuaDebugEvents_Type // ---------------------------------------------------------------------------- ! enum wxLuaDebugEvents_Type { ! wxLUA_EVENT_DEBUG_BREAK, ! wxLUA_EVENT_DEBUG_PRINT, ! wxLUA_EVENT_DEBUG_ERROR, ! wxLUA_EVENT_DEBUG_EXIT, ! wxLUA_EVENT_DEBUG_STACK_ENUM, ! wxLUA_EVENT_DEBUG_STACK_ENTRY_ENUM, ! wxLUA_EVENT_DEBUG_TABLE_ENUM, ! wxLUA_EVENT_DEBUG_EVALUATE_EXPR, ! wxLUA_EVENT_DEBUG_BREAKPOINT_ADDED, ! wxLUA_EVENT_DEBUG_BREAKPOINT_REMOVED }; // ---------------------------------------------------------------------------- ! // wxLuaDebugCommands_Type // ---------------------------------------------------------------------------- ! enum wxLuaDebugCommands_Type { ! wxLUA_CMD_ADD_BREAKPOINT, ! wxLUA_CMD_REMOVE_BREAKPOINT, ! wxLUA_CMD_CLEAR_ALL_BREAKPOINTS, ! wxLUA_CMD_RUN_BUFFER, ! wxLUA_CMD_DEBUG_STEP, ! wxLUA_CMD_DEBUG_STEPOVER, ! wxLUA_CMD_DEBUG_STEPOUT, ! wxLUA_CMD_DEBUG_CONTINUE, ! wxLUA_CMD_DEBUG_BREAK, ! wxLUA_CMD_ENUMERATE_STACK, ! wxLUA_CMD_ENUMERATE_STACK_ENTRY, ! wxLUA_CMD_ENUMERATE_TABLE_REF, ! wxLUA_CMD_EVALUATE_EXPR, ! wxLUA_CMD_RESET, ! wxLUA_CMD_CLEAR_DEBUG_REFERENCES, ! wxLUA_CMD_DISABLE_BREAKPOINT, ! wxLUA_CMD_ENABLE_BREAKPOINT }; --- 24,71 ---- // ---------------------------------------------------------------------------- ! // wxLuaScoketDebugEvents_Type // ---------------------------------------------------------------------------- ! enum wxLuaScoketDebugEvents_Type { ! wxLUASOCKET_DEBUG_EVENT_NONE = 0, ! ! wxLUASOCKET_DEBUG_EVENT_BREAK, ! wxLUASOCKET_DEBUG_EVENT_PRINT, ! wxLUASOCKET_DEBUG_EVENT_ERROR, ! wxLUASOCKET_DEBUG_EVENT_EXIT, ! wxLUASOCKET_DEBUG_EVENT_STACK_ENUM, ! wxLUASOCKET_DEBUG_EVENT_STACK_ENTRY_ENUM, ! wxLUASOCKET_DEBUG_EVENT_TABLE_ENUM, ! wxLUASOCKET_DEBUG_EVENT_EVALUATE_EXPR, ! wxLUASOCKET_DEBUG_EVENT_BREAKPOINT_ADDED, ! wxLUASOCKET_DEBUG_EVENT_BREAKPOINT_REMOVED }; // ---------------------------------------------------------------------------- ! // wxLuaSocketDebugCommands_Type // ---------------------------------------------------------------------------- ! enum wxLuaSocketDebugCommands_Type { ! wxLUASOCKET_DEBUG_CMD_NONE = 0, ! ! wxLUASOCKET_DEBUG_CMD_ADD_BREAKPOINT = 100, ! wxLUASOCKET_DEBUG_CMD_REMOVE_BREAKPOINT, ! wxLUASOCKET_DEBUG_CMD_CLEAR_ALL_BREAKPOINTS, ! wxLUASOCKET_DEBUG_CMD_RUN_BUFFER, ! wxLUASOCKET_DEBUG_CMD_DEBUG_STEP, ! wxLUASOCKET_DEBUG_CMD_DEBUG_STEPOVER, ! wxLUASOCKET_DEBUG_CMD_DEBUG_STEPOUT, ! wxLUASOCKET_DEBUG_CMD_DEBUG_CONTINUE, ! wxLUASOCKET_DEBUG_CMD_DEBUG_BREAK, ! wxLUASOCKET_DEBUG_CMD_ENUMERATE_STACK, ! wxLUASOCKET_DEBUG_CMD_ENUMERATE_STACK_ENTRY, ! wxLUASOCKET_DEBUG_CMD_ENUMERATE_TABLE_REF, ! wxLUASOCKET_DEBUG_CMD_EVALUATE_EXPR, ! wxLUASOCKET_DEBUG_CMD_RESET, ! wxLUASOCKET_DEBUG_CMD_CLEAR_DEBUG_REFERENCES, ! wxLUASOCKET_DEBUG_CMD_DISABLE_BREAKPOINT, ! wxLUASOCKET_DEBUG_CMD_ENABLE_BREAKPOINT }; *************** *** 102,106 **** 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(); --- 106,110 ---- 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(); *************** *** 119,123 **** virtual void NotifyError(const wxString &msg); ! virtual int HandleDebugEvent(wxLuaDebugEvents_Type event_type); virtual wxLuaSocketBase* GetSocketBase() { return NULL; } --- 123,127 ---- virtual void NotifyError(const wxString &msg); ! virtual int HandleDebugEvent(wxLuaScoketDebugEvents_Type event_type); virtual wxLuaSocketBase* GetSocketBase() { return NULL; } *************** *** 133,137 **** class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugServer : public wxLuaDebuggerBase ! { protected: // ---------------------------------------------------------------------------- --- 137,141 ---- class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugServer : public wxLuaDebuggerBase ! { protected: // ---------------------------------------------------------------------------- *************** *** 142,148 **** 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 --- 146,152 ---- 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 *************** *** 178,182 **** int m_portNumber; wxProcess *m_pProcess; ! LuaThread *m_pThread; wxLuaStackDialog *m_pStackDialog; bool m_fShutdown; --- 182,186 ---- int m_portNumber; wxProcess *m_pProcess; ! wxLuaDebugServer::LuaThread *m_pThread; wxLuaStackDialog *m_pStackDialog; bool m_fShutdown; Index: wxlsock.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxlsock.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxlsock.h 7 Sep 2006 22:42:19 -0000 1.10 --- wxlsock.h 13 Sep 2006 04:13:47 -0000 1.11 *************** *** 56,84 **** 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; ! // Write the whole buffer of size length to the socket ! virtual int Write(const char *buffer, int length) = 0; // Read data from the socket, calls virtual int Read(...) unsigned char ReadByte(); ! short ReadWord(); ! unsigned short ReadUWord(); ! int ReadInt(); ! unsigned int ReadUInt(); long ReadLong(); - unsigned long ReadULong(); wxString ReadString(); wxLuaDebugData ReadDebugData(); // Write data to the socket, calls virtual void Write(...) ! bool WriteCharData(const char* data, int length); ! bool WriteByte(unsigned char value); ! bool WriteWord(short value); ! bool WriteUWord(unsigned short value); ! bool WriteInt(int value); ! bool WriteUInt(unsigned int value); bool WriteLong(long value); - bool WriteULong(unsigned long value); bool WriteString(const wxString &value); bool WriteDebugData(const wxLuaDebugData& debugData); --- 56,77 ---- virtual bool IsConnected() = 0; ! // Read the number of bytes length into buffer buffer from the socket ! virtual int Read(char *buffer, wxUint32 length) = 0; ! // Write the whole buffer of number of bytes length to the socket ! virtual int Write(const char *buffer, wxUint32 length) = 0; // Read data from the socket, calls virtual int Read(...) unsigned char ReadByte(); ! wxInt32 ReadInt32(); ! wxUint32 ReadUInt32(); long ReadLong(); wxString ReadString(); wxLuaDebugData ReadDebugData(); // Write data to the socket, calls virtual void Write(...) ! bool WriteByte(char value); ! bool WriteInt32(wxInt32 value); ! bool WriteUInt32(wxUint32 value); bool WriteLong(long value); bool WriteString(const wxString &value); bool WriteDebugData(const wxLuaDebugData& debugData); *************** *** 166,172 **** int GetPort() const; // Read the whole buffer of size length into buffer buffer from the socket ! virtual int Read(char *buffer, int length); // Write the whole buffer of size length to the socket ! virtual int Write(const char *buffer, int length); // Shutdown the socket in an orderly fashion void Shutdown(int how); --- 159,165 ---- int GetPort() const; // Read the whole buffer of size length into buffer buffer from the socket ! virtual int Read(char *buffer, wxUint32 length); // Write the whole buffer of size length to the socket ! virtual int Write(const char *buffer, wxUint32 length); // Shutdown the socket in an orderly fashion void Shutdown(int how); Index: wxldtarg.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldtarg.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxldtarg.h 7 Sep 2006 22:42:19 -0000 1.14 --- wxldtarg.h 13 Sep 2006 04:13:47 -0000 1.15 *************** *** 15,19 **** #endif - #include "wx/dynarray.h" #include "wxluasocket/include/wxluasocketdefs.h" #include "wxlua/include/wxlua.h" --- 15,18 ---- *************** *** 22,52 **** // ---------------------------------------------------------------------------- - // wxLuaBuffer - // ---------------------------------------------------------------------------- - - class WXDLLIMPEXP_WXLUASOCKET wxLuaBuffer : public wxObject - { - public: - wxLuaBuffer(const wxString &fileName, const wxString &buffer) - : m_fileName(fileName), m_buffer(buffer) {} - - wxString GetBuffer() const { return m_buffer; } - wxString GetFileName() const { return m_fileName; } - int GetBufferLength() const { return m_buffer.Length(); } - - private: - wxString m_fileName; - wxString m_buffer; - DECLARE_ABSTRACT_CLASS(wxLuaBuffer) - }; - - - #if wxCHECK_VERSION(2, 5, 0) - WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxLuaBuffer *, wxLuaBufferArray, class WXDLLIMPEXP_WXLUASOCKET); - #else - WX_DEFINE_ARRAY(wxLuaBuffer *, wxLuaBufferArray); - #endif // !wxCHECK_VERSION(2, 5, 0) - - // ---------------------------------------------------------------------------- // wxLuaDebugTarget - a C++ socket target that the wxLuaDebugServer run in lua // communicates with. Handles the Debugger/Debuggee IO --- 21,24 ---- *************** *** 64,68 **** 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 --- 36,40 ---- 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 *************** *** 105,113 **** bool m_fRunning; bool m_fStopped; bool m_fErrorsSeen; int m_nFramesUntilBreak; wxMutex m_runMutex; wxCondition m_runCondition; ! wxLuaBufferArray m_bufferList; LuaThread *m_pThread; wxArrayInt m_references; --- 77,86 ---- bool m_fRunning; bool m_fStopped; + bool m_fExiting; bool m_fErrorsSeen; int m_nFramesUntilBreak; wxMutex m_runMutex; wxCondition m_runCondition; ! wxArrayString m_bufferArray; LuaThread *m_pThread; wxArrayInt m_references; *************** *** 116,119 **** --- 89,93 ---- mutable wxCriticalSection m_breakPointListCriticalSection; + wxString CreateBreakPoint(const wxString &fileName, int lineNumber) const; bool AddBreakPoint(const wxString &fileName, int lineNumber); Index: dservice.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/dservice.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dservice.h 7 Sep 2006 22:42:19 -0000 1.15 --- dservice.h 13 Sep 2006 04:13:47 -0000 1.16 *************** *** 78,84 **** // Read the whole buffer of size length into buffer buffer from the socket ! virtual int Read(char *buffer, int length); // Write the whole buffer of size length to the socket ! virtual int Write(const char *buffer, int length); // operators --- 78,84 ---- // Read the whole buffer of size length into buffer buffer from the socket ! virtual int Read(char *buffer, wxUint32 length); // Write the whole buffer of size length to the socket ! virtual int Write(const char *buffer, wxUint32 length); // operators |