From: John L. <jr...@us...> - 2005-12-02 06:38:39
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1520/modules/wxluasocket/src Modified Files: dservice.cpp wxldserv.cpp wxldtarg.cpp wxlsock.cpp Log Message: restore the stacktree for the wxLua app more code unification for wxLuaDebug classes revert to EnumerateStack, EnumerateStackEntry, EnumerateTable instead of BuildStack, BuildStackList, BuildTableList Index: wxldtarg.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxldtarg.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxldtarg.cpp 1 Dec 2005 06:43:54 -0000 1.5 --- wxldtarg.cpp 2 Dec 2005 06:38:31 -0000 1.6 *************** *** 101,105 **** m_pThread = new LuaThread(this); // Start the thread ! if ((m_pThread != NULL) && (m_pThread->Create() == wxTHREAD_NO_ERROR) && (m_pThread->Run() == wxTHREAD_NO_ERROR)) --- 101,105 ---- m_pThread = new LuaThread(this); // Start the thread ! if ((m_pThread != NULL) && (m_pThread->Create() == wxTHREAD_NO_ERROR) && (m_pThread->Run() == wxTHREAD_NO_ERROR)) *************** *** 419,423 **** wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->BuildStack(m_wxlState); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); --- 419,423 ---- wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->EnumerateStack(m_wxlState); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); *************** *** 432,436 **** wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->BuildStackList(m_wxlState, stackRef, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); --- 432,436 ---- wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->EnumerateStackEntry(m_wxlState, stackRef, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); *************** *** 445,449 **** wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->BuildTableList(m_wxlState, tableRef, nIndex, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); --- 445,449 ---- wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->EnumerateTable(m_wxlState, tableRef, nIndex, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); *************** *** 557,561 **** case LUA_TTABLE: ! strResult = wxT("table ") + GetTableInfo(-1); break; --- 557,561 ---- case LUA_TTABLE: ! strResult = wxT("table ") + wxLuaDebugData::GetTableInfo(m_wxlState, -1); break; *************** *** 568,576 **** case LUA_TUSERDATA: ! strResult = wxT("user data ") + GetUserDataInfo(-1); break; case LUA_TLIGHTUSERDATA: ! strResult = wxT("light user data ") + GetUserDataInfo(-1, false); break; --- 568,576 ---- case LUA_TUSERDATA: ! strResult = wxT("user data ") + wxLuaDebugData::GetUserDataInfo(m_wxlState, -1); break; case LUA_TLIGHTUSERDATA: ! strResult = wxT("light user data ") + wxLuaDebugData::GetUserDataInfo(m_wxlState, -1, false); break; *************** *** 591,626 **** } - wxString wxLuaDebugTarget::GetTableInfo(int index) - { - int nItems = luaL_getn(m_wxlState.GetLuaState(), index); - const void *pItem = lua_topointer(m_wxlState.GetLuaState(), index); - - if (nItems == 0) - return wxString::Format(wxT("%p"), pItem); - - return wxString::Format(wxT("%p (approx %u items)"), pItem, nItems); - } - - wxString wxLuaDebugTarget::GetUserDataInfo(int index, bool full) - { - lua_State* L = m_wxlState.GetLuaState(); - if (full) - { - - int nTag = m_wxlState.ttag(index); - - const char *pTagName = NULL; - if (nTag != TLUA_NOTAG) - pTagName = m_wxlState.GetLuaTagName(nTag); - - if (pTagName != NULL) - return wxString::Format(wxT("%p (%s)"), lua_touserdata(L, index), pTagName); - - return wxString::Format(wxT("%p (%u)"), lua_touserdata(L, index), nTag); - } - - return wxString::Format(wxT("%p"), lua_touserdata(L, index)); - } - bool wxLuaDebugTarget::NotifyBreak(const wxString &fileName, int lineNumber) { --- 591,594 ---- Index: dservice.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/dservice.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dservice.cpp 1 Dec 2005 06:43:54 -0000 1.6 --- dservice.cpp 2 Dec 2005 06:38:31 -0000 1.7 *************** *** 1585,1589 **** wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->BuildStack(m_wxlState); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); --- 1585,1589 ---- wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->EnumerateStack(m_wxlState); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); *************** *** 1598,1602 **** wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->BuildStackList(m_wxlState, stackRef, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); --- 1598,1602 ---- wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->EnumerateStackEntry(m_wxlState, stackRef, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); *************** *** 1611,1615 **** wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->BuildTableList(m_wxlState, tableRef, nIndex, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); --- 1611,1615 ---- wxLuaHandler::GetHandler().EnterLuaCriticalSection(); ! pSortedList->EnumerateTable(m_wxlState, tableRef, nIndex, m_references); wxLuaHandler::GetHandler().LeaveLuaCriticalSection(); *************** *** 1743,1747 **** case LUA_TTABLE: ! strResult = wxT("table ") + GetTableInfo(-1); break; --- 1743,1747 ---- case LUA_TTABLE: ! strResult = wxT("table ") + wxLuaDebugData::GetTableInfo(m_wxlState, -1); break; *************** *** 1754,1762 **** case LUA_TUSERDATA: ! strResult = wxT("user data ") + GetUserDataInfo(-1); break; case LUA_TLIGHTUSERDATA: ! strResult = wxT("light user data ") + GetUserDataInfo(-1, false); break; --- 1754,1762 ---- case LUA_TUSERDATA: ! strResult = wxT("user data ") + wxLuaDebugData::GetUserDataInfo(m_wxlState, -1); break; case LUA_TLIGHTUSERDATA: ! strResult = wxT("light user data ") + wxLuaDebugData::GetUserDataInfo(m_wxlState, -1, false); break; *************** *** 1777,1810 **** } - wxString wxLuaDebuggee::GetTableInfo(int index) - { - int nItems = luaL_getn(m_wxlState.GetLuaState(), index); - const void *pItem = lua_topointer(m_wxlState.GetLuaState(), index); - - if (nItems == 0) - return wxString::Format(wxT("%p"), pItem); - - return wxString::Format(wxT("%p (approx %u items)"), pItem, nItems); - } - - wxString wxLuaDebuggee::GetUserDataInfo(int index, bool full) - { - if (full) - { - int nTag = m_wxlState.ttag(index); - - const char *pTagName = NULL; - if (nTag != TLUA_NOTAG) - pTagName = m_wxlState.GetLuaTagName(nTag); - - if (pTagName != NULL) - return wxString::Format(wxT("%p (%s)"), lua_touserdata(m_wxlState.GetLuaState(), index), pTagName); - - return wxString::Format(wxT("%p (%u)"), lua_touserdata(m_wxlState.GetLuaState(), index), nTag); - } - - return wxString::Format(wxT("%p"), lua_touserdata(m_wxlState.GetLuaState(), index)); - } - wxFileName wxLuaDebuggee::GetDebugInfo(int &lineNumber) const { --- 1777,1780 ---- Index: wxldserv.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxldserv.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxldserv.cpp 1 Dec 2005 06:43:54 -0000 1.5 --- wxldserv.cpp 2 Dec 2005 06:38:31 -0000 1.6 *************** *** 667,672 **** --- 667,675 ---- wxSize(500, 250), this); + + wxLuaHandler::GetHandler().SetStackFrame(m_pStackFrameDialog); m_pStackFrameDialog->ShowModal(); m_pStackFrameDialog->Destroy(); + wxLuaHandler::GetHandler().SetStackFrame(NULL); m_pStackFrameDialog = NULL; return true; Index: wxlsock.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxlsock.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlsock.cpp 1 Dec 2005 04:17:29 -0000 1.2 --- wxlsock.cpp 2 Dec 2005 06:38:31 -0000 1.3 *************** *** 29,33 **** extern const wxCharBuffer wx2lua(const wxString& AppString); ! extern wxString lua2wx(const char * wx2lua); // ---------------------------------------------------------------------------- --- 29,33 ---- extern const wxCharBuffer wx2lua(const wxString& AppString); ! extern wxString lua2wx(const char* c_str); // ---------------------------------------------------------------------------- |