Esempio n. 1
0
 void debugProcessExit(object sender, ProcessEventArgs e)
 {
     if (Exited != null && ExeFileName != null)
         Exited(ExeFileName);
     curPage = null;            
     show_debug_tabs = true;
     workbench.WidgetController.SetPlayButtonsVisible(false);
     workbench.WidgetController.SetAddExprMenuVisible(false);
     DebugWatchListWindowForm.WatchWindow.ClearAllSubTrees();
     IsRunning = false;
     workbench.WidgetController.SetDebugStopDisabled();
     workbench.WidgetController.ChangeContinueDebugNameOnStart();
     //if (cur_brpt != null) dbg.RemoveBreakpoint(cur_brpt);
     CurrentLineBookmark.Remove();
     WorkbenchServiceFactory.DebuggerOperationsService.ClearLocalVarTree();
     WorkbenchServiceFactory.DebuggerOperationsService.ClearDebugTabs();
     WorkbenchServiceFactory.DebuggerOperationsService.ClearWatch();
     workbench.WidgetController.SetDebugTabsVisible(false);
     WorkbenchServiceFactory.OperationsService.ClearTabStack();
     workbench.WidgetController.EnableCodeCompletionToolTips(true);
     RemoveGotoBreakpoints();
     AssemblyHelper.Unload();
     CloseOldToolTip();
     //RemoveMarker(frm.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Document);
     evaluator = null;
     parser= null;
     FileName = null;
     handle = 0;
     ExeFileName = null;
     FullFileName = null;
     PrevFullFileName = null;
     Status = DebugStatus.None;
     dbg.ProcessStarted -= debugProcessStarted;
     dbg.ProcessExited -= debugProcessExit;
     dbg.BreakpointHit -= debugBreakpointHit;
     debuggedProcess = null;
     //GC.Collect();
     //dbg = null;
 }
Esempio n. 2
0
 public void Attach(uint handle, string fileName, bool real_attach, bool late_attach)
 {
 	if (!real_attach)
 	{
 		this.handle = handle;
 		this.ExeFileName = fileName;
 		IsRunning = true;
 		return;
 	}
 	if (handle == 0)
 		return;
 	if (Starting != null)
         Starting(fileName);
 	
 	string sourceFileName = null;
 	if (!ProjectFactory.Instance.ProjectLoaded)
 	    sourceFileName = workbench.VisualEnvironmentCompiler.Compiler.CompilerOptions.SourceFileName;
 	else
 	    sourceFileName = ProjectFactory.Instance.CurrentProject.MainFile;
 	this.FileName = sourceFileName;//Path.GetFileNameWithoutExtension(fileName) + ".pas";
     this.FullFileName = Path.Combine(Path.GetDirectoryName(fileName), this.FileName);
     this.ExeFileName = fileName;
     CurrentLine = 0;
     this.parser = CodeCompletion.CodeCompletionController.ParsersController.selectParser(Path.GetExtension(FullFileName).ToLower());
     this.PrevFullFileName = FullFileName;
     AssemblyHelper.LoadAssembly(fileName);
 	dbg.ProcessStarted += debugProcessStarted;
     dbg.ProcessExited += debugProcessExit;
     //brPoint = dbg.AddBreakpoint(FileName, frm.VisualEnvironmentCompiler.Compiler.BeginOffset);
     try
     {
         debuggedProcess = dbg.DebugActiveProcess(handle, fileName);
     }
     catch (System.Exception ex)
     {
         return;
     }
 	SelectProcess(debuggedProcess);
 	//debuggedProcess.Break();
 }