//HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message); public static void o2KernelQueue_onMessages(IO2Message o2Message) { if (o2Message is IM_O2MdbgAction) { IM_O2MdbgAction o2MDbgAction = (IM_O2MdbgAction)o2Message; switch (o2MDbgAction.o2MdbgAction) { case IM_O2MdbgActions.breakEvent: { string filename = o2MDbgAction.filename; int line = o2MDbgAction.line; DI.log.info("SOURCECODE REF -> {0} : {1})", new object[] { line, filename }); O2.Kernel.CodeUtils.O2Messages.fileOrFolderSelected(filename, line); //HandleO2MessageOnSD.setSelectedLineNumber(filename, line); break; } case IM_O2MdbgActions.debugProcessRequest: O2MDbgUtils.startProcessUnderDebugger(o2MDbgAction.filename); break; case IM_O2MdbgActions.debugMethodInfoRequest: O2MDbgUtils.debugMethod(o2MDbgAction.method, o2MDbgAction.loadDllsFrom); break; case IM_O2MdbgActions.setBreakpointOnFile: O2MDbgUtils.setBreakPointOnFile(o2MDbgAction.filename, o2MDbgAction.line); break; } } }
static void ascx_Scripts_onMessages(IO2Message o2Message) { HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message); if (o2Message is IM_O2MdbgAction) { var o2MDbgAction = (IM_O2MdbgAction)o2Message; switch (o2MDbgAction.o2MdbgAction) { case IM_O2MdbgActions.breakEvent: var filename = o2MDbgAction.filename; var line = o2MDbgAction.line; DI.log.info("SOURCECODE REF -> {0} : {1})", line, filename); HandleO2MessageOnSD.setSelectedLineNumber(filename, line); break; case IM_O2MdbgActions.debugProcessRequest: O2MDbgUtils.startProcessUnderDebugger(o2MDbgAction.filename); break; case IM_O2MdbgActions.debugMethodInfoRequest: O2MDbgUtils.debugMethod(o2MDbgAction.method, o2MDbgAction.loadDllsFrom); break; } } }
private void btStartProcess_Click(object sender, EventArgs e) { var executableToStart = tbExecutableToStartAndDebug.Text; btStartProcess.Enabled = false; O2MDbgUtils.startProcessUnderDebugger(executableToStart); updateGuiEnabledControlState(); Processes.Sleep(1000); // wait a bit before reenabling this button btStartProcess.Enabled = true; }
public void test_startSampleFileUnderDebuggerAndStepIntoIt() { // before we start the process we need to set the callback for global O2Messages (so that we pick up the OnBreakpoint message) PublicDI.o2MessageQueue.onMessages += o2Message => { DI.log.info("message received: {0}", o2Message.messageText); if (o2Message is IM_O2MdbgAction) { var o2MDbgAction = (IM_O2MdbgAction)o2Message; if (o2MDbgAction.o2MdbgAction == IM_O2MdbgActions.breakEvent) { var filename = o2MDbgAction.filename; var line = o2MDbgAction.line; DI.log.info("SOURCECODE REF -> {0} : {1})", line, filename); setSelectedLineNumber(filename, line); } } }; // start process under debuggger var startThread = O2MDbgUtils.startProcessUnderDebugger(assemblyToExecute); // wait for it completes execution startThread.Join(); Assert.That(O2MDbgUtils.IsActive(), "Debugger should be active"); Assert.That(false == O2MDbgUtils.IsRunning(), "Debugger should Not be running"); var selectedLine = getSelectedLineNumber(); O2MDbgUtils.stepIntoAnimated(); /* Assert.That(selectedLine != currentSelectedLine, * "After debugger started the selectedLine != currentSelectedLine: " + selectedLine + " != " + * currentSelectedLine);*/ // Processes.Sleep(3000); //O2AscxGUI.invokeOnAscxControl(ascxScriptControl,) O2AscxGUI.logInfo("all ready"); }