From: John L. <jr...@us...> - 2006-12-08 06:16:21
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8247/wxLua/samples Modified Files: editor.wx.lua Log Message: subclass the wxProcess in the debugger so we don't have to send an event fixes crashes when an error occurs in the debugger's lua program test compile lua programs before running or debugging to catch syntax errors Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** editor.wx.lua 8 Dec 2006 01:12:35 -0000 1.36 --- editor.wx.lua 8 Dec 2006 06:16:18 -0000 1.37 *************** *** 77,87 **** programName = nil -- the name of the wxLua program to be used when starting debugger findData = nil -- wxFindData object ! fHaveFound = false -- true when string has been found editorApp = wx.wxGetApp() ! debugServer = nil -- wxLuaDebuggerServer object when debugging ! fIsRunning = false -- true when the debuggee is running ! fIsConnected = false -- true when a client has connected ! portNumber = 1551 -- the port # to use for debugging -- wxWindow variables --- 77,87 ---- programName = nil -- the name of the wxLua program to be used when starting debugger findData = nil -- wxFindData object ! found_string = false -- true when string has been found in editor editorApp = wx.wxGetApp() ! debuggerServer = nil -- wxLuaDebuggerServer object when debugging, else nil ! debuggee_running = false -- true when the debuggee is running ! debugger_connected = false -- true when a client has connected ! debuggerPortNumber = 1551 -- the port # to use for debugging -- wxWindow variables *************** *** 259,263 **** -- Update the statusbar text of the frame using the given editor function UpdateStatusText(editor) ! if editor then local pos = editor:GetCurrentPos() local line = editor:LineFromPosition(pos) --- 259,263 ---- -- Update the statusbar text of the frame using the given editor function UpdateStatusText(editor) ! if editor and frame then local pos = editor:GetCurrentPos() local line = editor:LineFromPosition(pos) *************** *** 590,597 **** function ProcessWatches() ! if watchListCtrl and debugServer then for idx = 0, watchListCtrl:GetItemCount() - 1 do local expression = watchListCtrl:GetItemText(idx) ! debugServer:EvaluateExpr(idx, expression) end end --- 590,597 ---- function ProcessWatches() ! if watchListCtrl and debuggerServer then for idx = 0, watchListCtrl:GetItemCount() - 1 do local expression = watchListCtrl:GetItemText(idx) ! debuggerServer:EvaluateExpr(idx, expression) end end *************** *** 797,814 **** frame:Connect(ID_OPEN, wx.wxEVT_COMMAND_MENU_SELECTED, OpenFile) function SaveFile(editor, filePath) ! if filePath then local backPath = filePath..".bak" os.remove(backPath) os.rename(filePath, backPath) ! end ! local handle = io.open(filePath, "wb") ! if handle then ! local st = editor:GetText() ! handle:write(st) ! handle:close() ! editor:EmptyUndoBuffer() ! SetDocumentModified(editor:GetId(), false, true) ! return true end --- 797,822 ---- frame:Connect(ID_OPEN, wx.wxEVT_COMMAND_MENU_SELECTED, OpenFile) + -- save the file to filePath or if filePath is nil then call SaveFileAs function SaveFile(editor, filePath) ! if not filePath then ! return SaveFileAs(editor) ! else local backPath = filePath..".bak" os.remove(backPath) os.rename(filePath, backPath) ! ! local handle = io.open(filePath, "wb") ! if handle then ! local st = editor:GetText() ! handle:write(st) ! handle:close() ! editor:EmptyUndoBuffer() ! SetDocumentModified(editor:GetId(), false, true) ! return true ! else ! wx.wxMessageBox("Unable to save file '"..fileName.."'.", ! "wxLua Error Saving", ! wx.wxOK + wx.wxCENTRE, frame) ! end end *************** *** 821,829 **** local id = editor:GetId() local filePath = openDocuments[id].filePath ! if not filePath then ! SaveFileAs(editor) ! else ! SaveFile(editor, filePath) ! end end) --- 829,833 ---- local id = editor:GetId() local filePath = openDocuments[id].filePath ! SaveFile(editor, filePath) end) *************** *** 886,892 **** if document.isModified then ! if not filePath then ! SaveFileAs(editor) ! elseif SaveFile(editor, filePath) then SetDocumentModified(editor:GetId(), false, false) end --- 890,894 ---- if document.isModified then ! if SaveFile(editor, filePath) then SetDocumentModified(editor:GetId(), false, false) end *************** *** 965,973 **** dialog:Destroy() if result == wx.wxID_YES then ! if not filePath then ! saved = SaveFileAs(editor) ! else ! saved = SaveFile(editor, filePath) ! end end end --- 967,971 ---- dialog:Destroy() if result == wx.wxID_YES then ! saved = SaveFile(editor, filePath) end end *************** *** 980,984 **** function (event) local editor = GetEditor() ! event:Enable((editor ~= nil) and (debugServer == nil)) end) --- 978,982 ---- function (event) local editor = GetEditor() ! event:Enable((editor ~= nil) and (debuggerServer == nil)) end) *************** *** 1001,1010 **** dialog:Destroy() if result == wx.wxID_YES then ! local filePath = document.filePath ! if not filePath then ! SaveFileAs(editor) ! else ! SaveFile(editor, filePath) ! end end end --- 999,1003 ---- dialog:Destroy() if result == wx.wxID_YES then ! SaveFile(editor, document.filePath) end end *************** *** 1201,1209 **** end if posFind == -1 then ! fHaveFound = false frame:SetStatusText("Find text not found.") else ! fHaveFound = true local start = editor:GetTargetStart() local finish = editor:GetTargetEnd() --- 1194,1202 ---- end if posFind == -1 then ! found_string = false frame:SetStatusText("Find text not found.") else ! found_string = true local start = editor:GetTargetStart() local finish = editor:GetTargetEnd() *************** *** 1251,1255 **** end else ! if fHaveFound then local replaceLen = string.len(strReplace) local start = editor:GetSelectionStart() --- 1244,1248 ---- end else ! if found_string then local replaceLen = string.len(strReplace) local start = editor:GetSelectionStart() *************** *** 1259,1263 **** editor:ReplaceTarget(strReplace) editor:SetSelection(start + replaceLen, finish) ! fHaveFound = false end --- 1252,1256 ---- editor:ReplaceTarget(strReplace) editor:SetSelection(start + replaceLen, finish) ! found_string = false end *************** *** 1447,1457 **** if markers >= BREAKPOINT_MARKER_VALUE then editor:MarkerDelete(line, BREAKPOINT_MARKER) ! if debugServer then ! debugServer:RemoveBreakPoint(filePath, line) end else editor:MarkerAdd(line, BREAKPOINT_MARKER) ! if debugServer then ! debugServer:AddBreakPoint(filePath, line) end end --- 1440,1450 ---- if markers >= BREAKPOINT_MARKER_VALUE then editor:MarkerDelete(line, BREAKPOINT_MARKER) ! if debuggerServer then ! debuggerServer:RemoveBreakPoint(filePath, line) end else editor:MarkerAdd(line, BREAKPOINT_MARKER) ! if debuggerServer then ! debuggerServer:AddBreakPoint(filePath, line) end end *************** *** 1466,1469 **** --- 1459,1463 ---- errorLog:AddText(message) errorLog:SetReadOnly(true) + errorLog:GotoPos(errorLog:GetLength()) end *************** *** 1476,1492 **** frame:Connect(ID_TOGGLEBREAKPOINT, wx.wxEVT_UPDATE_UI, OnUpdateUIEditMenu) frame:Connect(ID_COMPILE, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! local editor = GetEditor() ! local editorText = editor:GetText() ! local id = editor:GetId() ! local filePath = MakeDebugFileName(editor, openDocuments[id].filePath) ! local ret, errMsg, line_num = wx.CompileLuaScript(editorText, filePath) ! ! if line_num > -1 then ! DisplayOutput("Compliation error on line number :"..tostring(line_num).."\n") ! editor:GotoLine(line_num-1) ! end ! DisplayOutput(errMsg.."\n") end) frame:Connect(ID_COMPILE, wx.wxEVT_UPDATE_UI, OnUpdateUIEditMenu) --- 1470,1493 ---- frame:Connect(ID_TOGGLEBREAKPOINT, wx.wxEVT_UPDATE_UI, OnUpdateUIEditMenu) + function CompileProgram(editor) + local editorText = editor:GetText() + local id = editor:GetId() + local filePath = MakeDebugFileName(editor, openDocuments[id].filePath) + local ret, errMsg, line_num = wx.CompileLuaScript(editorText, filePath) + + if line_num > -1 then + DisplayOutput("Compliation error on line number :"..tostring(line_num).."\n") + editor:GotoLine(line_num-1) + end + + DisplayOutput(errMsg.."\n") + + return line_num == -1 -- return true it it compiles ok + end + frame:Connect(ID_COMPILE, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! local editor = GetEditor() ! CompileProgram(editor) end) frame:Connect(ID_COMPILE, wx.wxEVT_UPDATE_UI, OnUpdateUIEditMenu) *************** *** 1508,1511 **** --- 1509,1517 ---- ]] local editor = GetEditor(); + -- test compile it before we run it + if not CompileProgram(editor) then + return + end + local id = editor:GetId(); if openDocuments[id].isModified then *************** *** 1543,1547 **** function (event) local editor = GetEditor() ! event:Enable((debugServer == nil) and (editor ~= nil)) end) --- 1549,1553 ---- function (event) local editor = GetEditor() ! event:Enable((debuggerServer == nil) and (editor ~= nil)) end) *************** *** 1549,1576 **** function (event) local ok = false ! debugServer = wx.wxLuaDebuggerServer(portNumber) ! if debugServer then ! ok = debugServer:StartServer() end if ok then ! DisplayOutput("Waiting for client connect. Start client with wxLua -d"..wx.wxGetHostName()..":"..portNumber.."\n") else DisplayOutput("Unable to create debugger server.\n") end ! portNumber = portNumber + 1 end) frame:Connect(ID_ATTACH_DEBUG, wx.wxEVT_UPDATE_UI, function (event) local editor = GetEditor() ! event:Enable((debugServer == nil) and (editor ~= nil)) end) ! function CreateDebugServer() ! debugServer = wx.wxLuaDebuggerServer(portNumber) ! local ok = debugServer:StartServer() if not ok then ! debugServer:Delete() ! debugServer = nil DisplayOutput("Error starting the debug server.\n") return nil --- 1555,1582 ---- function (event) local ok = false ! debuggerServer = wx.wxLuaDebuggerServer(debuggerPortNumber) ! if debuggerServer then ! ok = debuggerServer:StartServer() end if ok then ! DisplayOutput("Waiting for client connect. Start client with wxLua -d"..wx.wxGetHostName()..":"..debuggerPortNumber.."\n") else DisplayOutput("Unable to create debugger server.\n") end ! debuggerPortNumber = debuggerPortNumber + 1 end) frame:Connect(ID_ATTACH_DEBUG, wx.wxEVT_UPDATE_UI, function (event) local editor = GetEditor() ! event:Enable((debuggerServer == nil) and (editor ~= nil)) end) ! function CreateDebuggerServer() ! debuggerServer = wx.wxLuaDebuggerServer(debuggerPortNumber) ! local ok = debuggerServer:StartServer() if not ok then ! debuggerServer:Delete() ! debuggerServer = nil DisplayOutput("Error starting the debug server.\n") return nil *************** *** 1580,1609 **** local nextLine = editor:MarkerNext(0, BREAKPOINT_MARKER_VALUE) while nextLine ~= -1 do ! debugServer:AddBreakPoint(fileName, nextLine) nextLine = editor:MarkerNext(nextLine + 1, BREAKPOINT_MARKER_VALUE) end end ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED, function (event) local ok = false ! if debugServer then for id, document in pairs(openDocuments) do local editor = document.editor local editorText = editor:GetText() local filePath = MakeDebugFileName(editor, document.filePath) ! ok = debugServer:Run(filePath, editorText) DownloadBreakpoints(editor, filePath) end if ok then ! ok = debugServer:Step() end ! fIsConnected = ok ! fIsRunning = ok UpdateUIMenuItems() end ! if debugServer and ok then DisplayOutput("Client connected ok.\n") else --- 1586,1615 ---- local nextLine = editor:MarkerNext(0, BREAKPOINT_MARKER_VALUE) while nextLine ~= -1 do ! debuggerServer:AddBreakPoint(fileName, nextLine) nextLine = editor:MarkerNext(nextLine + 1, BREAKPOINT_MARKER_VALUE) end end ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED, function (event) local ok = false ! if debuggerServer then for id, document in pairs(openDocuments) do local editor = document.editor local editorText = editor:GetText() local filePath = MakeDebugFileName(editor, document.filePath) ! ok = debuggerServer:Run(filePath, editorText) DownloadBreakpoints(editor, filePath) end if ok then ! ok = debuggerServer:Step() end ! debugger_connected = ok ! debuggee_running = ok UpdateUIMenuItems() end ! if debuggerServer and ok then DisplayOutput("Client connected ok.\n") else *************** *** 1612,1621 **** end) ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED, function (event) DisplayOutput(event:GetMessage().."\n") DisplayOutput("Debug server disconnected.\n") ! debugServer:Delete() ! debugServer = nil end) --- 1618,1627 ---- end) ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED, function (event) DisplayOutput(event:GetMessage().."\n") DisplayOutput("Debug server disconnected.\n") ! debuggerServer:Delete() ! debuggerServer = nil end) *************** *** 1630,1634 **** end ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_BREAK, function (event) if exitingProgram then return end --- 1636,1640 ---- end ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_BREAK, function (event) if exitingProgram then return end *************** *** 1687,1709 **** if fileFound then ! fIsRunning = false ProcessWatches() ! elseif debugServer then ! debugServer:Continue() ! fIsRunning = true end end) ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_PRINT, function (event) DisplayOutput(event:GetMessage().."\n") end) ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_ERROR, function (event) ! DisplayOutput("wxLua ERROR: "..event:GetMessage().."\n") end) ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_EXIT, function (event) DisplayOutput("\nDebugger Client finished.\n\n") --- 1693,1715 ---- if fileFound then ! debuggee_running = false ProcessWatches() ! elseif debuggerServer then ! debuggerServer:Continue() ! debuggee_running = true end end) ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_PRINT, function (event) DisplayOutput(event:GetMessage().."\n") end) ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_ERROR, function (event) ! DisplayOutput("wxLua ERROR: "..event:GetMessage().."\n\n") end) ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_EXIT, function (event) DisplayOutput("\nDebugger Client finished.\n\n") *************** *** 1713,1721 **** editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! fIsConnected = false ! if debugServer then ! debugServer:Delete() ! debugServer = nil ! fIsRunning = false end SetAllEditorsReadOnly(false) --- 1719,1727 ---- editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! debugger_connected = false ! if debuggerServer then ! debuggerServer:Delete() ! debuggerServer = nil ! debuggee_running = false end SetAllEditorsReadOnly(false) *************** *** 1723,1727 **** end) ! debugServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_EVALUATE_EXPR, function (event) if watchListCtrl then --- 1729,1733 ---- end) ! debuggerServer:Connect(wx.wxID_ANY, wx.wxEVT_WXLUA_DEBUGGER_EVALUATE_EXPR, function (event) if watchListCtrl then *************** *** 1732,1763 **** end) ! return debugServer end frame:Connect(ID_START_DEBUG, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) local ok = false ! debugServer = CreateDebugServer() ! if debugServer then ! ok = debugServer:StartClient() end ! if debugServer and ok then SetAllEditorsReadOnly(true) DisplayOutput("Waiting for client connection.\n") else ! DisplayOutput("Unable to create debugger server.\n"..tostring(debugServer)..tostring(ok)) ! if debugServer then ! debugServer:Delete() ! debugServer = nil end end ! portNumber = portNumber + 1 end) frame:Connect(ID_START_DEBUG, wx.wxEVT_UPDATE_UI, function (event) local editor = GetEditor() ! event:Enable((debugServer == nil) and (editor ~= nil)) end) --- 1738,1775 ---- end) ! return debuggerServer end frame:Connect(ID_START_DEBUG, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) + local editor = GetEditor() + -- test compile it before we run it + if not CompileProgram(editor) then + return + end + local ok = false ! debuggerServer = CreateDebuggerServer() ! if debuggerServer then ! ok = debuggerServer:StartClient() end ! if debuggerServer and ok then SetAllEditorsReadOnly(true) DisplayOutput("Waiting for client connection.\n") else ! DisplayOutput("Unable to start debuggee.\n") ! if debuggerServer then ! debuggerServer:Delete() ! debuggerServer = nil end end ! debuggerPortNumber = debuggerPortNumber + 1 end) frame:Connect(ID_START_DEBUG, wx.wxEVT_UPDATE_UI, function (event) local editor = GetEditor() ! event:Enable((debuggerServer == nil) and (editor ~= nil)) end) *************** *** 1768,1775 **** editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! fIsConnected = false ! if debugServer then ! local ds = debugServer ! debugServer = nil ds:Reset() ds:StopServer() --- 1780,1787 ---- editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! debugger_connected = false ! if debuggerServer then ! local ds = debuggerServer ! debuggerServer = nil ds:Reset() ds:StopServer() *************** *** 1778,1788 **** SetAllEditorsReadOnly(false) ignoredFilesList = {} ! fIsRunning = false ! DisplayOutput("\nDebuggee client stopped.\n") end) frame:Connect(ID_STOP_DEBUG, wx.wxEVT_UPDATE_UI, function (event) local editor = GetEditor() ! event:Enable((debugServer ~= nil) and (editor ~= nil)) end) --- 1790,1800 ---- SetAllEditorsReadOnly(false) ignoredFilesList = {} ! debuggee_running = false ! DisplayOutput("\nDebuggee client stopped.\n\n") end) frame:Connect(ID_STOP_DEBUG, wx.wxEVT_UPDATE_UI, function (event) local editor = GetEditor() ! event:Enable((debuggerServer ~= nil) and (editor ~= nil)) end) *************** *** 1793,1799 **** editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debugServer then ! debugServer:Step() ! fIsRunning = true end end) --- 1805,1811 ---- editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debuggerServer then ! debuggerServer:Step() ! debuggee_running = true end end) *************** *** 1801,1805 **** function (event) local editor = GetEditor() ! event:Enable((debugServer ~= nil) and (not fIsRunning) and (editor ~= nil)) end) --- 1813,1817 ---- function (event) local editor = GetEditor() ! event:Enable((debuggerServer ~= nil) and (not debuggee_running) and (editor ~= nil)) end) *************** *** 1810,1816 **** editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debugServer then ! debugServer:StepOver() ! fIsRunning = true end end) --- 1822,1828 ---- editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debuggerServer then ! debuggerServer:StepOver() ! debuggee_running = true end end) *************** *** 1818,1822 **** function (event) local editor = GetEditor() ! event:Enable((debugServer ~= nil) and (not fIsRunning) and (editor ~= nil)) end) --- 1830,1834 ---- function (event) local editor = GetEditor() ! event:Enable((debuggerServer ~= nil) and (not debuggee_running) and (editor ~= nil)) end) *************** *** 1827,1838 **** editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debugServer then ! debugServer:StepOut() ! fIsRunning = true end end) frame:Connect(ID_STEP_OUT, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debugServer ~= nil) and (not fIsRunning)) end) --- 1839,1850 ---- editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debuggerServer then ! debuggerServer:StepOut() ! debuggee_running = true end end) frame:Connect(ID_STEP_OUT, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debuggerServer ~= nil) and (not debuggee_running)) end) *************** *** 1843,1876 **** editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debugServer then ! debugServer:Continue() ! fIsRunning = true end end) frame:Connect(ID_CONTINUE, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debugServer ~= nil) and (not fIsRunning)) end) frame:Connect(ID_BREAK, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! if debugServer then ! debugServer:Break() end end) frame:Connect(ID_BREAK, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debugServer ~= nil) and fIsRunning) end) frame:Connect(ID_VIEWCALLSTACK, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! if debugServer then ! debugServer:DisplayStackDialog(frame) end end) frame:Connect(ID_VIEWCALLSTACK, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debugServer ~= nil) and (not fIsRunning)) end) --- 1855,1888 ---- editor:MarkerDeleteAll(CURRENT_LINE_MARKER) end ! if debuggerServer then ! debuggerServer:Continue() ! debuggee_running = true end end) frame:Connect(ID_CONTINUE, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debuggerServer ~= nil) and (not debuggee_running)) end) frame:Connect(ID_BREAK, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! if debuggerServer then ! debuggerServer:Break() end end) frame:Connect(ID_BREAK, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debuggerServer ~= nil) and debuggee_running) end) frame:Connect(ID_VIEWCALLSTACK, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) ! if debuggerServer then ! debuggerServer:DisplayStackDialog(frame) end end) frame:Connect(ID_VIEWCALLSTACK, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debuggerServer ~= nil) and (not debuggee_running)) end) *************** *** 1883,1887 **** frame:Connect(ID_VIEWWATCHWINDOW, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debugServer ~= nil) and (not fIsRunning)) end) --- 1895,1899 ---- frame:Connect(ID_VIEWWATCHWINDOW, wx.wxEVT_UPDATE_UI, function (event) ! event:Enable((debuggerServer ~= nil) and (not debuggee_running)) end) *************** *** 1970,1980 **** function CloseWindow(event) exitingProgram = true ! fIsConnected = false ! if debugServer then ! debugServer:Reset() ! debugServer:Delete() ! debugServer = nil end ! fIsRunning = false SaveOnExit() ConfigSaveFramePosition(frame, "MainFrame") --- 1982,1992 ---- function CloseWindow(event) exitingProgram = true ! debugger_connected = false ! if debuggerServer then ! debuggerServer:Reset() ! debuggerServer:Delete() ! debuggerServer = nil end ! debuggee_running = false SaveOnExit() ConfigSaveFramePosition(frame, "MainFrame") |