Exemplo n.º 1
0
        public void InterpreteSet()
        {
            AST CurrentAST = Input.Read();

            if ((CurrentAST.Target as AST).ASTType == AST.Classification.Of)
            {
                InterpreteOf(CurrentAST.Target as AST);
                OutputManager.Set(Maybe(CurrentAST.Value as AST, InterpreteIdentifier, InterpreteNumber, InterpreteBoolean, InterpreteString));
                return;
            }
            string property = InterpreteIdentifier(CurrentAST.Target as AST) as string;

            OutputManager.Select(property);

            object result = null;

            if (Expected(AST.Classification.Identifier, NextAST: CurrentAST.Value as AST))
            {
                result = OutputManager.FindObject((InterpreteIdentifier(CurrentAST.Value as AST) as string));
            }
            else
            {
                result = Maybe(CurrentAST.Value as AST, InterpreteNumber, InterpreteBoolean, InterpreteString);
            }

            OutputManager.Set(result);
        }
Exemplo n.º 2
0
        void TheDebugger_OnProcessStateChanged(object sender, DebuggerEventArgs e)
        {
            var dbg = (DnDebugger)sender;

            switch (dbg.ProcessState)
            {
            case DebuggerProcessState.Starting:
                if (outputLoggerSettings.ShowDebugOutputLog)
                {
                    outputManager.Select(GUID_OUTPUT_LOGGER_DEBUG);
                }

                debugState?.Dispose();
                debugState = null;

                textPane.Clear();
                dbg.DebugCallbackEvent += DnDebugger_DebugCallbackEvent;
                debugState              = new DebugState(dbg);
                break;

            case DebuggerProcessState.Continuing:
            case DebuggerProcessState.Running:
            case DebuggerProcessState.Paused:
                Debug.Assert(debugState != null && debugState.dbg == dbg);
                break;

            case DebuggerProcessState.Terminated:
                Debug.Assert(debugState != null);
                Debug.Assert(debugState?.dbg == dbg);

                if (outputLoggerSettings.ShowProcessExitMessages)
                {
                    int processExitCode;
                    if (!NativeMethods.GetExitCodeProcess(debugState.hProcess_debuggee, out processExitCode))
                    {
                        processExitCode = -1;
                    }
                    textPane.WriteLine(BoxedTextColor.DebugLogExitProcess,
                                       string.Format(dnSpy_Debugger_Resources.DebugLogExitProcess,
                                                     GetProcessNameWithPID(debugState.debuggedProcess),
                                                     processExitCode));
                }

                debugState?.Dispose();
                debugState = null;
                break;
            }
        }