Esempio n. 1
0
 public SourceDump(SourceDumperOptions options, UsageDefinition definition, IEnvironment environment,
     IDebugger debugger, IConsole console, IVersion versionGetter,
     IWriterFactory factory)
     : base(options, definition, environment, debugger, console, versionGetter)
 {
     _factory = factory;
 }
Esempio n. 2
0
 public ScriptEngine(String moduleName, IDebugger debugger, Options options = Options.Ecmascript5 | Options.Strict)
     : base(options)
 {
     this.debugger = debugger;
     this.moduleName = moduleName;
     SetDebugMode(debugger != null);
 }
Esempio n. 3
0
        public CodeRunner(IDebugger debugger, string source)
        {
            _debugger = debugger;
            _source = source;

            Context = new Context(new Scope());
            CodeGenerator = new Code();
        }
		public RunScriptingConsoleApplicationCommand(IScriptingWorkbench workbench, 
			IDebugger debugger,
			ScriptingConsoleApplication scriptingConsoleApplication)
		{
			this.workbench = workbench;
			this.debugger = debugger;
			this.scriptingConsoleApplication = scriptingConsoleApplication;
		}
Esempio n. 5
0
		public MSTestDebugger(
			IUnitTestDebuggerService debuggerService,
			IUnitTestMessageService messageService)
		{
			this.debuggerService = debuggerService;
			this.messageService = messageService;
			this.debugger = debuggerService.CurrentDebugger;
		}
Esempio n. 6
0
 protected ProgramDefinition(Options options, UsageDefinition definition, IEnvironment environment,
     IDebugger debugger, IConsole console, IVersion versionGetter)
 {
     _options = options;
     _definition = definition;
     _environment = environment;
     _debugger = debugger;
     _console = console;
     _versionGetter = versionGetter;
 }
Esempio n. 7
0
        public IScriptEngine LoadScript(Stream scriptStream, string name, IDebugger debugger)
        {
            if (_scripts.ContainsKey(name))
                return _scripts[name];

            var engine = new Script.ScriptEngine(name, debugger);
            _scripts.Add(name, engine);
            if (scriptStream != null)
                engine.Run(new StreamReader(scriptStream));
            return engine;
        }
		public async Task EvaluateAsync(IDebugger debugger, bool evaluateChildren = true)
		{
			this.debugger = debugger;

			Value = await debugger.EvaluateExpressionAsync(Id);

			if (NumChildren > 0 && evaluateChildren)
			{
				await EvaluateChildrenInternalAsync();
			}
		}
		public TestDebuggerBase(IUnitTestDebuggerService debuggerService,
			IUnitTestMessageService messageService,
			ITestResultsMonitor testResultsMonitor)
		{
			this.debuggerService = debuggerService;
			this.messageService = messageService;
			this.testResultsMonitor = testResultsMonitor;
			this.debugger = debuggerService.CurrentDebugger;
			
			testResultsMonitor.TestFinished += OnTestFinished;
		}
Esempio n. 10
0
		public PSSession(IDebugger debugger, IProgram program)
		{
			_program = program;
			var initialSessionState = InitialSessionState.CreateDefault();			
			initialSessionState.Variables.Add(new SessionStateVariableEntry("Debugger", debugger,
				"Interface to the Windows debuggers", ScopedItemOptions.Constant));
			initialSessionState.Variables.Add(new SessionStateVariableEntry("ShellID", "PSExt", "", ScopedItemOptions.Constant));
			var location = Assembly.GetExecutingAssembly().Location;
			initialSessionState.ImportPSModule(new []{location });
			var formatFile = Path.Combine(Path.GetDirectoryName(location), "PSExtCmdlets.Format.ps1xml");
			initialSessionState.Formats.Add(new SessionStateFormatEntry(formatFile));		
			_host = new DbgPsHost(debugger, program);
			_runspace = RunspaceFactory.CreateRunspace(_host, initialSessionState);
		}
Esempio n. 11
0
        public void Activate()
        {
            if (active != ActiveState.NotStarted)
                throw new InvalidOperationException("Wrong state");

            active = ActiveState.Active;

            dbg = zm.Debug();
            src = new SourceCache(sourcePath);

            io.PutString("ZLR Debugger\n");
            dbg.Restart();
            ShowStatus();
        }
        internal DebuggerSubscriptionContext(IDebugger debugger, Action<IDebugMessage> action)
        {
            IsEnabled = true;

            DEBUGGER = debugger;
            DEBUGGER.DebugMessageReceived += HANDLER = (sender, e) =>
                {
                    if (!IsEnabled)
                    {
                        return;
                    }

                    action(e.Message);
                };
        }
Esempio n. 13
0
        public void SetDebugger(IDebugger debugger)
        {
            if (this.debugger != null)
            {
                //this.debugger.StateChanged -= Debugger_StateChanged;
            }

            if (debugger != null)
            {
                //debugger.StateChanged += Debugger_StateChanged;
            }

            this.debugger = debugger;

            dataProvider.SetDebugger(debugger);
        }
Esempio n. 14
0
        public static Script Compile(Code code, Context context, string source, IDebugger debugger)
        {
            if (debugger != null) debugger.SetSourceCode(source);

            context.SetFunction("eval", (string c) =>
                                            {
                                                var bkCode = source;
                                                var scope = context.Scope;
                                                context.Scope = new Scope {Obj = scope.Obj};
                                                var result = Compile(code, context, c, debugger).Run();

                                                CloneProperties(context, context.Scope.Obj, scope.Obj);

                                                context.Scope = scope;

                                                if (debugger != null) debugger.SetSourceCode(bkCode);

                                                return result;
                                            });

            context.SetFunction("isNaN", (object value) => value == JsObject.NaN);

            JsObject instance = null;

            if (!_cache.ContainsKey(source))
            {
                var csCode = GetCsCode(code, Parse(source, debugger != null, context));
                Assembly asm = CSScript.LoadCode(csCode);
                var type = asm.GetType("C0");
                var args = new List<object>();
                context.Actions.ToList().ForEach(a => args.Add(a.Value));
                args.Add(debugger);
                instance = (JsObject) Activator.CreateInstance(type, args.ToArray());

                _cache[source] = instance;
            }
            else
            {
                instance = _cache[source];
            }

            CloneProperties(context, context.Scope.Obj, instance);

            context.Scope.Obj = instance;

            return new Script(context);
        }
Esempio n. 15
0
 void OnDebugStopped()
 {
     m_currentDebugger = null;
     view.ItemsSource = null;
 }
Esempio n. 16
0
 void OnDebugStarted()
 {
     m_currentDebugger = DebuggerService.CurrentDebugger;
     RefreshPad();
 }
Esempio n. 17
0
//		static string GetMemberText(IAmbience ambience, IEntity member, string expression, out bool debuggerCanShowValue)
//		{
//			bool tryDisplayValue = false;
//			debuggerCanShowValue = false;
//			StringBuilder text = new StringBuilder();
//			if (member is IField) {
//				text.Append(ambience.Convert(member as IField));
//				tryDisplayValue = true;
//			} else if (member is IProperty) {
//				text.Append(ambience.Convert(member as IProperty));
//				tryDisplayValue = true;
//			} else if (member is IEvent) {
//				text.Append(ambience.Convert(member as IEvent));
//			} else if (member is IMethod) {
//				text.Append(ambience.Convert(member as IMethod));
//			} else if (member is IClass) {
//				text.Append(ambience.Convert(member as IClass));
//			} else {
//				text.Append("unknown member ");
//				text.Append(member.ToString());
//			}
//			if (tryDisplayValue && currentDebugger != null) {
//				LoggingService.Info("asking debugger for value of '" + expression + "'");
//				string currentValue = currentDebugger.GetValueAsString(expression);
//				if (currentValue != null) {
//					debuggerCanShowValue = true;
//					text.Append(" = ");
//					text.Append(currentValue);
//				}
//			}
//			string documentation = member.Documentation;
//			if (documentation != null && documentation.Length > 0) {
//				text.Append('\n');
//				text.Append(ICSharpCode.SharpDevelop.Editor.CodeCompletion.CodeCompletionItem.ConvertDocumentation(documentation));
//			}
//			return text.ToString();
//		}
		#endregion
		
		public static void SetDebugger(Lazy<IDebugger> debugger)
		{
			currentDebugger = debugger.Value;
		}
Esempio n. 18
0
 public Minifier(IDebugger debugger, HttpContextBase httpContext)
 {
     _debugger = debugger;
     _httpContext = httpContext;
 }
Esempio n. 19
0
        /// <summary>
        /// Detaches the debugger from a process if the host settings require it.
        /// </summary>
        protected void DetachDebuggerIfNeeded()
        {
            if (debugger != null && debuggedProcess != null)
            {
                Logger.Log(LogSeverity.Important, "Detaching debugger from the host.");

                DetachDebuggerResult result = debugger.DetachFromProcess(debuggedProcess);
                if (result == DetachDebuggerResult.CouldNotDetach)
                    Logger.Log(LogSeverity.Warning, "Could not detach debugger from the host.");

                debuggedProcess = null;
                debugger = null;
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Attaches the debugger to a process if the host settings require it.
        /// </summary>
        protected void AttachDebuggerIfNeeded(IDebuggerManager debuggerManager, Process debuggedProcess)
        {
            if (HostSetup.DebuggerSetup != null)
            {
                IDebugger debugger = debuggerManager.GetDebugger(HostSetup.DebuggerSetup, Logger);

                if (! Debugger.IsAttached)
                {
                    Logger.Log(LogSeverity.Important, "Attaching debugger to the host.");

                    AttachDebuggerResult result = debugger.AttachToProcess(debuggedProcess);
                    if (result == AttachDebuggerResult.Attached)
                    {
                        this.debugger = debugger;
                        this.debuggedProcess = debuggedProcess;
                    }
                    else if (result == AttachDebuggerResult.CouldNotAttach)
                    {
                        Logger.Log(LogSeverity.Warning, "Could not attach debugger to the host.");
                    }
                }
            }
        }
		internal void AttachDebugger(IDebugger debugger)
		{
			m_Debug.DebuggerAttached = debugger;
			m_Debug.LineBasedBreakPoints = (debugger.GetDebuggerCaps() & DebuggerCaps.HasLineBasedBreakpoints) != 0;
			debugger.SetDebugService(new DebugService(m_Script, this));
		}
		static IDebugger GetCompatibleDebugger()
		{
			return currentDebugger = new WindowsDebugger();
		}
Esempio n. 23
0
 public ReferenceManager(IUnityContainer container, ReferenceOptions options, UsageDefinition definition,
     IEnvironment environment, IDebugger debugger, IConsole console, IVersion versionGetter)
     : base(options, definition, environment, debugger, console, versionGetter)
 {
     _container = container;
 }
Esempio n. 24
0
 void OnDebugStarted(object sender, EventArgs args)
 {
 	m_currentDebugger = DebuggerService.CurrentDebugger;
 	m_currentDebugger.IsProcessRunningChanged += new EventHandler(OnProcessRunningChanged);
 	
 	OnProcessRunningChanged(null, EventArgs.Empty);
 }
Esempio n. 25
0
 public void AttachDebugger(IDebugger debugger)
 {
     m_Debugger = debugger;
 }
Esempio n. 26
0
		public static int Initialize(IDebugger debugger, IProgram program)
		{
			_theSession = new PSSession(debugger, program);
			return 0;
		}
Esempio n. 27
0
		public RunDebugRubyCommand(IScriptingWorkbench workbench, RubyAddInOptions options, IDebugger debugger) 
			: base(workbench, options, debugger)
		{
			Debug = true;
		}
Esempio n. 28
0
 public ConsoleMain(Options options, UsageDefinition definition, IEnvironment environment, IDebugger debugger, IConsole console, IVersion versionGetter)
     : base(options, definition, environment, debugger, console, versionGetter)
 {
 }
Esempio n. 29
0
		private void SetDebuggers(IDebugger debugger)
		{
			BreakPointManager.SetDebugger(debugger);

			if (DebuggerChanged != null)
			{
				DebuggerChanged(this, new EventArgs());
			}
		}
Esempio n. 30
0
        void OnDebugStopped(object sender, EventArgs args)
        {        	
        	m_currentDebugger.IsProcessRunningChanged -= new EventHandler(OnProcessRunningChanged);
        	m_currentDebugger = null;
			view.ItemsSource = null;
        }
Esempio n. 31
0
		/// <summary>
		/// Attaches a debugger. This usually should be called by the debugger itself and not by user code.
		/// </summary>
		/// <param name="debugger">The debugger object.</param>
		public void AttachDebugger(IDebugger debugger)
		{
			m_Debugger = debugger;
			m_MainProcessor.AttachDebugger(debugger);

			foreach (SourceCode src in m_Sources)
				SignalSourceCodeChange(src);

			SignalByteCodeChange();
		}
 public RunDebugPythonCommand(IScriptingWorkbench workbench, PythonAddInOptions options, IDebugger debugger)
     : base(workbench, options, debugger)
 {
     Debug = true;
 }