Наследование: Mono.Debugger.DebuggerMarshalByRefObject, IInterruptionHandler, IDisposable
Пример #1
0
		public LocalsStore(DebuggerService debuggerService, Interpreter interpreter)
		{
			this.debuggerService = debuggerService;
			this.interpreter = interpreter;
			this.rootVariable = new LocalVariablesRoot(interpreter);
			this.RootNode.SetValue(ColumnUpdateChilds, true);
		}
Пример #2
0
        public EmonicLineInterpreter(DebuggerConfiguration config, DebuggerOptions options)
        {
            if (options.HasDebugFlags)
                Report.Initialize (options.DebugOutput, options.DebugFlags);
            else
                Report.Initialize ();

            interpreter = new EmonicInterpreter (config, options);
            engine = interpreter.DebuggerEngine;
            parser = new LineParser (engine);
            main_thread = new ST.Thread (new System.Threading.ThreadStart(main_thread_main));
            main_thread.IsBackground = true;

            command_thread = new ST.Thread (new ST.ThreadStart (command_thread_main));
            command_thread.IsBackground = true;
        }
Пример #3
0
        internal CommandLineInterpreter(DebuggerOptions options, bool is_interactive)
        {
            if (options.HasDebugFlags)
                Report.Initialize (options.DebugOutput, options.DebugFlags);
            else
                Report.Initialize ();

            Configuration = new DebuggerConfiguration ();
            #if HAVE_XSP
            if (options.StartXSP)
                Configuration.SetupXSP ();
            else
                Configuration.LoadConfiguration ();
            #else
            Configuration.LoadConfiguration ();
            #endif

            Configuration.SetupCLI ();

            interpreter = new Interpreter (is_interactive, Configuration, options);
            interpreter.CLI = this;

            engine = interpreter.DebuggerEngine;
            parser = new LineParser (engine);

            if (!interpreter.IsScript) {
                line_editor = new LineEditor ("mdb");

                line_editor.AutoCompleteEvent += delegate (string text, int pos) {
                    return engine.Completer.Complete (text, pos);
                };

                Console.CancelKeyPress += control_c_event;
            }

            interrupt_event = new ST.AutoResetEvent (false);
            nested_break_state_event = new ST.AutoResetEvent (false);

            main_loop_stack = new Stack<MainLoop> ();
            main_loop_stack.Push (new MainLoop (interpreter));

            main_thread = new ST.Thread (new ST.ThreadStart (main_thread_main));
            main_thread.IsBackground = true;
        }
Пример #4
0
        public CommandLineInterpreter(Interpreter interpreter)
        {
            this.interpreter = interpreter;
            this.engine = interpreter.DebuggerEngine;

            interpreter.CLI = this;
            parser = new LineParser (engine);

            interrupt_event = new ST.AutoResetEvent (false);
            nested_break_state_event = new ST.AutoResetEvent (false);

            Console.CancelKeyPress += control_c_event;

            main_loop_stack = new Stack<MainLoop> ();
            main_loop_stack.Push (new MainLoop (interpreter));

            main_thread = new ST.Thread (new ST.ThreadStart (main_thread_main));
            main_thread.IsBackground = true;
        }
Пример #5
0
        public override void TargetStopped(Interpreter interpreter, StackFrame frame,
						    AssemblerLine current_insn)
        {
            if (frame != null) {
                if (!PrintSource (interpreter, frame))
                    native = true;

                interpreter.ShowDisplays (frame);
            }
            if (native && (current_insn != null))
                interpreter.PrintInstruction (current_insn);
        }
Пример #6
0
 public ProcessEventSink(Interpreter interpreter, Process process)
 {
     this.interpreter = interpreter;
     process.TargetOutputEvent += target_output;
 }
Пример #7
0
 public StyleEmacs(Interpreter interpreter)
     : base(interpreter)
 {
 }
Пример #8
0
        protected bool PrintSource(Interpreter interpreter, StackFrame frame)
        {
            SourceAddress location = frame.SourceAddress;
            if (location == null)
                return false;

            SourceBuffer buffer;
            if (location.SourceFile != null) {
                string filename = location.SourceFile.FileName;
                buffer = interpreter.SourceFileFactory.FindFile (filename);
            } else
                buffer = location.SourceBuffer;

            if ((buffer == null) || (buffer.Contents == null) || (location.Row == 0))
                return false;

            string line = buffer.Contents [location.Row - 1];
            interpreter.Print (String.Format ("{0,4} {1}", location.Row, line));
            return true;
        }
Пример #9
0
        public abstract void TargetStopped(Interpreter interpreter, StackFrame frame,
						    AssemblerLine current_insn);
Пример #10
0
		public ThreadsStore(DebuggerService debuggerService, Interpreter interpreter)
		{
			this.debuggerService = debuggerService;
			this.interpreter = interpreter;
		}
Пример #11
0
        public Engine(Interpreter interpreter)
        {
            this.Interpreter = interpreter;

            Completer = new Completer (this);
        }
Пример #12
0
		public CallstackStore(DebuggerService debuggerService, Interpreter interpreter)
		{
			this.debuggerService = debuggerService;
			this.interpreter = interpreter;
		}
Пример #13
0
            public MainLoop(Interpreter interpreter)
            {
                this.Interpreter = interpreter;

                command_event = new ST.ManualResetEvent (false);
                completed_event = new ST.ManualResetEvent (false);

                command_thread = new ST.Thread (new ST.ThreadStart (command_thread_main));
                command_thread.Start ();
            }
Пример #14
0
        public override void UnhandledException(Interpreter interpreter, StackFrame frame,
							 AssemblerLine insn)
        {
            TargetStopped (interpreter, frame, insn);
        }
Пример #15
0
        public static TargetClassObject CheckTypeProxy(Interpreter interpreter, Thread thread,
								TargetStructObject obj)
        {
            if (obj.Type.DebuggerTypeProxyAttribute == null)
                return null;

            ScriptingContext expr_context = new ScriptingContext (interpreter);
            expr_context.CurrentThread = thread;
            expr_context.CurrentLanguage = obj.Type.Language;
            expr_context.ImplicitInstance = obj;

            return expr_context.CheckTypeProxy (obj);
        }
Пример #16
0
 protected StyleBase(Interpreter interpreter)
 {
     this.interpreter = interpreter;
 }
Пример #17
0
        public static EE.EvaluationResult HandleDebuggerDisplay(Interpreter interpreter,
									 Thread thread,
									 TargetStructObject instance,
									 DebuggerDisplayAttribute attr,
									 int timeout, out string name,
									 out string type)
        {
            ScriptingContext expr_context = new ScriptingContext (interpreter);
            expr_context.CurrentThread = thread;
            expr_context.CurrentLanguage = instance.Type.Language;
            expr_context.ImplicitInstance = instance;

            EE.EvaluationResult result = expr_context.HandleDebuggerDisplay (
                 thread, instance, attr.Value, timeout, out name);

            if (result != EE.EvaluationResult.Ok) {
                type = null;
                return result;
            }

            if (String.IsNullOrEmpty (attr.Type)) {
                type = null;
                return EE.EvaluationResult.Ok;
            }

            return expr_context.HandleDebuggerDisplay (
                thread, instance, attr.Type, timeout, out type);
        }
Пример #18
0
        public abstract void UnhandledException(Interpreter interpreter, StackFrame frame,
							 AssemblerLine current_insn);
Пример #19
0
 public ScriptingContext(Interpreter interpreter)
 {
     this.interpreter = interpreter;
 }
Пример #20
0
 public StyleCLI(Interpreter interpreter)
     : base(interpreter)
 {
 }
Пример #21
0
		public BreakpointsStore(DebuggerService debuggerService, Interpreter interpreter)
		{
			this.debuggerService = debuggerService;
			this.interpreter = interpreter;
		}
Пример #22
0
        public override void TargetStopped(Interpreter interpreter, StackFrame frame,
						    AssemblerLine current_insn)
        {
            if (frame == null)
                return;

            if (frame != null && frame.SourceAddress != null)
                Console.WriteLine ("\x1A\x1A{0}:{1}:beg:{2}",
                           frame.SourceAddress.Name, "55" /* XXX */,
                           "0x80594d8" /* XXX */);
        }
Пример #23
0
		private DebuggerService(string[] args)
		{
			mono_debugger_server_static_init ();
			
			bool is_interactive = true;
			
			DebuggerConfiguration config = new DebuggerConfiguration ();
			config.LoadConfiguration ();
			
			DebuggerOptions options = DebuggerOptions.ParseCommandLine (args);
			if (options.HasDebugFlags)
				Report.Initialize (options.DebugOutput, options.DebugFlags);
			else
				Report.Initialize ();
			
			// Redirect the Reporter output stream   HACK: Using reflection
			reporterOutput = new MemoryStream();
			FieldInfo writerField = typeof(ReportWriter).GetField("writer", BindingFlags.NonPublic | BindingFlags.Instance);
			StreamWriter writer = new StreamWriter(reporterOutput);
			writer.AutoFlush = true;
			writerField.SetValue(Report.ReportWriter, writer);
			// Redirect the console
			//Console.SetOut(writer);
			//Console.SetError(writer);
			
			interpreter = new GuiInterpreter(this, is_interactive, config, options);
			engine = interpreter.DebuggerEngine;
			parser = new LineParser (engine);
			
			this.breakpointsStore = new BreakpointsStore(this, interpreter);
			this.callstackStore = new CallstackStore(this, interpreter);
			this.localsStore = new LocalsStore(this, interpreter);
			this.threadsStore = new ThreadsStore(this, interpreter);
			
			if (interpreter.Options.StartTarget) {
				interpreter.Start ();
			}
			
			NotifyStateChange();
		}
Пример #24
0
            public InterpreterEventSink(Interpreter interpreter, Debugger debugger)
            {
                this.interpreter = interpreter;

                debugger.TargetExitedEvent += target_exited;
                debugger.ThreadCreatedEvent += thread_created;
                debugger.ManagedThreadCreatedEvent += managed_thread_created;
                debugger.ThreadExitedEvent += thread_exited;
                debugger.MainProcessCreatedEvent += main_process_created;
                debugger.ProcessReachedMainEvent += process_reached_main;
                debugger.ProcessCreatedEvent += process_created;
                debugger.ProcessExitedEvent += process_exited;
                debugger.ProcessExecdEvent += process_execd;
                debugger.TargetEvent += target_event;
                debugger.EnterNestedBreakStateEvent +=
                    delegate (Debugger unused, Thread thread) {
                        interpreter.OnEnterNestedBreakState (thread);
                    };
                debugger.LeaveNestedBreakStateEvent +=
                    delegate (Debugger unused, Thread thread) {
                        interpreter.OnLeaveNestedBreakState (thread);
                    };
            }
Пример #25
0
        internal ExpressionParser(Interpreter interpreter)
        {
            this.Interpreter = interpreter;

            parser = new CSharp.ExpressionParser ("C#");
        }