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(); }
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(); }