Exemplo n.º 1
0
        public AppMenu(DebugManager mgr, AccelGroup agr,
		       Settings set, Window parent,
		       DebugPane pane, string argsOverride)
        {
            settings = set;
            debugPane = pane;
            debugManager = mgr;
            menuBar = new MenuBar();
            preferences = new PreferencesDialog(set, parent, argsOverride);

            menuBar.Append(CreateFileMenu(agr));
            menuBar.Append(CreateEditMenu(agr));
            menuBar.Append(CreateViewMenu(agr));
            menuBar.Append(CreateDebuggerMenu(agr));
            menuBar.Append(CreateHelpMenu(agr));

            debugManager.DebuggerBusy += OnDebuggerBusy;
            debugManager.DebuggerReady += OnDebuggerReady;
            debugManager.DebuggerStarted += OnDebuggerStarted;
            debugManager.DebuggerExited += OnDebuggerExited;

            menuBar.Destroyed += OnDestroy;

            debuggerStop.Sensitive = false;
            debuggerInterrupt.Sensitive = false;

            foreach (MenuItem m in commandMacros)
            m.Sensitive = false;
        }
Exemplo n.º 2
0
        public DebugView(Settings set, DebugManager mgr)
        {
            debugManager = mgr;
            layout = new Table(2, 2, false);
            runStop = new Button("Interrupt");
            command = new Entry();
            log = new ConsoleLog(set);

            command.Activated += OnCommand;
            runStop.Clicked += OnRunStop;

            layout.Attach(log.View, 0, 2, 0, 1,
              AttachOptions.Fill,
              AttachOptions.Expand | AttachOptions.Fill,
              4, 4);
            layout.Attach(command, 0, 1, 1, 2,
              AttachOptions.Fill | AttachOptions.Expand,
              AttachOptions.Fill,
              4, 4);
            layout.Attach(runStop, 1, 2, 1, 2,
              AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            runStop.SetSizeRequest(80, -1);

            command.Sensitive = false;
            runStop.Sensitive = false;

            mgr.MessageReceived += OnDebugOutput;
            mgr.DebuggerBusy += OnBusy;
            mgr.DebuggerReady += OnReady;
            mgr.DebuggerStarted += OnStarted;
            mgr.DebuggerExited += OnExited;
            layout.Destroyed += OnDestroy;
        }
Exemplo n.º 3
0
        public DebugPane(Settings set, DebugManager mgr)
        {
            settings = set;
            powerView = new PowerView(set, mgr);
            debugView = new DebugView(set, mgr);
            isPaned = settings.PowerGraphVisible;
            SetupLayout();

            settings.RefreshLayout += OnRefreshLayout;
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            Application.Init();

            try
            {
            string argsOverride = joinArguments(args);
            Settings settings = Settings.Load();
            DebugManager mgr = new DebugManager(settings, argsOverride);

            if ((args.Length <= 0) || hasNonOptions(args))
            new App(settings, mgr, argsOverride);

            if (args.Length > 0)
            mgr.Start();

            if ((args.Length <= 0) || hasNonOptions(args))
            Application.Run();

            // Synchronously terminate the debugger
            mgr.Terminate();
            while (mgr.IsRunning)
            Application.RunIteration();

            settings.Save();
            }
            catch (Exception ex)
            {
            MessageDialog dlg = new MessageDialog
            (null, DialogFlags.Modal, MessageType.Error,
             ButtonsType.Ok, "Unhandled exception: {0}",
             ex.Message);
            dlg.Title = "Olishell";

            dlg.Run();

            throw ex;
            }
        }
Exemplo n.º 5
0
        public App(Settings set, DebugManager mgr, string argsOverride)
        {
            settings = set;
            debugPane = new DebugPane(set, mgr);

            AccelGroup agr = new AccelGroup();
            menu = new AppMenu(mgr, agr, set, mainWin, debugPane,
                   argsOverride);
            toolbar = new AppToolbar(mgr, debugPane);

            VBox vb = new VBox(false, 3);

            mainWin.Resize(settings.WindowWidth, settings.WindowHeight);
            mainWin.DeleteEvent += (obj, evt) => Application.Quit();
            mainWin.AddAccelGroup(agr);

            vb.PackStart(menu.View, false, false, 0);
            vb.PackStart(toolbar.View, false, false, 0);
            vb.PackEnd(debugPane.View, true, true, 0);
            mainWin.Add(vb);

            mainWin.DeleteEvent += OnDeleteEvent;
            mainWin.ShowAll();
        }
Exemplo n.º 6
0
        public PowerView(Settings set, DebugManager mgr)
        {
            settings = set;
            debugManager = mgr;

            scale = FixScale(settings.PowerViewScale);

            drawer.ExposeEvent += OnExpose;
            drawer.SizeAllocated += OnSizeAllocate;
            drawer.Realized += OnRealize;

            scroll.AddWithViewport(drawer);
            scroll.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            scroll.SizeAllocated += OnScrollSizeAllocate;

            scroll.Destroyed += OnDestroy;
            debugManager.PowerChanged += OnPowerChanged;

            layout.PackStart(scroll, true, true, 0);
            layout.PackEnd(status, false, true, 0);
            status.SetAlignment(0.0f, 0.5f);

            updateStatus();
        }
Exemplo n.º 7
0
        public PowerView(Settings set, DebugManager mgr)
        {
            settings     = set;
            debugManager = mgr;

            scale = FixScale(settings.PowerViewScale);

            drawer.ExposeEvent   += OnExpose;
            drawer.SizeAllocated += OnSizeAllocate;
            drawer.Realized      += OnRealize;

            scroll.AddWithViewport(drawer);
            scroll.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            scroll.SizeAllocated += OnScrollSizeAllocate;

            scroll.Destroyed          += OnDestroy;
            debugManager.PowerChanged += OnPowerChanged;

            layout.PackStart(scroll, true, true, 0);
            layout.PackEnd(status, false, true, 0);
            status.SetAlignment(0.0f, 0.5f);

            updateStatus();
        }
Exemplo n.º 8
0
        public AppToolbar(DebugManager mgr, DebugPane dpane)
        {
            debugManager = mgr;
            debugPane = dpane;
            toolBar = new Toolbar();

            // Debugger control buttons
            debuggerStart = new ToolButton(Stock.MediaPlay);
            debuggerStart.Clicked += OnDebuggerStart;
            debuggerStart.Label = "Start";
            debuggerStart.TooltipText = "Start debugger";
            toolBar.Add(debuggerStart);

            debuggerStop = new ToolButton(Stock.MediaStop);
            debuggerStop.Clicked += OnDebuggerStop;
            debuggerStop.Label = "Stop";
            debuggerStop.TooltipText = "Stop debugger";
            toolBar.Add(debuggerStop);

            debuggerInterrupt = new ToolButton(Stock.Cancel);
            debuggerInterrupt.Clicked += OnDebuggerInterrupt;
            debuggerInterrupt.Label = "Interrupt";
            debuggerInterrupt.TooltipText = "Interrupt debugger";
            toolBar.Add(debuggerInterrupt);

            debuggerStart.Sensitive = true;
            debuggerStop.Sensitive = false;
            debuggerInterrupt.Sensitive = false;

            toolBar.Add(new SeparatorToolItem());

            // Command macros
            var cmdProg = new ToolButton(Stock.Open);
            cmdProg.Clicked += OnCommandProgram;
            cmdProg.Label = "Program";
            cmdProg.TooltipText = "Program...";
            toolBar.Add(cmdProg);
            commandMacros.Add(cmdProg);

            var cmdReset = new ToolButton(Stock.Clear);
            cmdReset.Clicked += (obj, evt) =>
            debugPane.DebugView.RunCommand("reset");
            cmdReset.Label = "Reset";
            cmdReset.TooltipText = "Reset";
            toolBar.Add(cmdReset);
            commandMacros.Add(cmdReset);

            var cmdRun = new ToolButton(Stock.GoForward);
            cmdRun.Clicked += (obj, evt) =>
            debugPane.DebugView.RunCommand("run");
            cmdRun.Label = "Run";
            cmdRun.TooltipText = "Run";
            toolBar.Add(cmdRun);
            commandMacros.Add(cmdRun);

            var cmdStep = new ToolButton(Stock.MediaNext);
            cmdStep.Clicked += (obj, evt) =>
            debugPane.DebugView.RunCommand("step");
            cmdStep.Label = "Step";
            cmdStep.TooltipText = "Step";
            toolBar.Add(cmdStep);
            commandMacros.Add(cmdStep);

            foreach (ToolButton m in commandMacros)
            m.Sensitive = false;

            toolBar.Add(new SeparatorToolItem());

            // Zoom controls
            var zoomIn = new ToolButton(Stock.ZoomIn);
            zoomIn.Clicked += (obj, evt) => debugPane.PowerView.ZoomIn();
            zoomIn.Label = "Zoom in";
            zoomIn.TooltipText = "Zoom in";
            toolBar.Add(zoomIn);

            var zoomOut = new ToolButton(Stock.ZoomOut);
            zoomOut.Clicked += (obj, evt) => debugPane.PowerView.ZoomOut();
            zoomOut.Label = "Zoom out";
            zoomOut.TooltipText = "Zoom out";
            toolBar.Add(zoomOut);

            var zoomFit = new ToolButton(Stock.ZoomFit);
            zoomFit.Clicked += (obj, evt) => debugPane.PowerView.ZoomFit();
            zoomFit.Label = "Zoom fit";
            zoomFit.TooltipText = "Zoom to fit";
            toolBar.Add(zoomFit);

            var zoomFull = new ToolButton(Stock.Zoom100);
            zoomFull.Clicked += (obj, evt) => debugPane.PowerView.ZoomFull();
            zoomFull.Label = "Zoom full";
            zoomFull.TooltipText = "Zoom full";
            toolBar.Add(zoomFull);

            // Debug manager listeners
            debugManager.DebuggerBusy += OnDebuggerBusy;
            debugManager.DebuggerReady += OnDebuggerReady;
            debugManager.DebuggerStarted += OnDebuggerStarted;
            debugManager.DebuggerExited += OnDebuggerExited;
        }
Exemplo n.º 9
0
        public AppToolbar(DebugManager mgr, DebugPane dpane)
        {
            debugManager = mgr;
            debugPane    = dpane;
            toolBar      = new Toolbar();

            // Debugger control buttons
            debuggerStart             = new ToolButton(Stock.MediaPlay);
            debuggerStart.Clicked    += OnDebuggerStart;
            debuggerStart.Label       = "Start";
            debuggerStart.TooltipText = "Start debugger";
            toolBar.Add(debuggerStart);

            debuggerStop             = new ToolButton(Stock.MediaStop);
            debuggerStop.Clicked    += OnDebuggerStop;
            debuggerStop.Label       = "Stop";
            debuggerStop.TooltipText = "Stop debugger";
            toolBar.Add(debuggerStop);

            debuggerInterrupt             = new ToolButton(Stock.Cancel);
            debuggerInterrupt.Clicked    += OnDebuggerInterrupt;
            debuggerInterrupt.Label       = "Interrupt";
            debuggerInterrupt.TooltipText = "Interrupt debugger";
            toolBar.Add(debuggerInterrupt);

            debuggerStart.Sensitive     = true;
            debuggerStop.Sensitive      = false;
            debuggerInterrupt.Sensitive = false;

            toolBar.Add(new SeparatorToolItem());

            // Command macros
            var cmdProg = new ToolButton(Stock.Open);

            cmdProg.Clicked    += OnCommandProgram;
            cmdProg.Label       = "Program";
            cmdProg.TooltipText = "Program...";
            toolBar.Add(cmdProg);
            commandMacros.Add(cmdProg);

            var cmdReset = new ToolButton(Stock.Clear);

            cmdReset.Clicked += (obj, evt) =>
                                debugPane.DebugView.RunCommand("reset");
            cmdReset.Label       = "Reset";
            cmdReset.TooltipText = "Reset";
            toolBar.Add(cmdReset);
            commandMacros.Add(cmdReset);

            var cmdRun = new ToolButton(Stock.GoForward);

            cmdRun.Clicked += (obj, evt) =>
                              debugPane.DebugView.RunCommand("run");
            cmdRun.Label       = "Run";
            cmdRun.TooltipText = "Run";
            toolBar.Add(cmdRun);
            commandMacros.Add(cmdRun);

            var cmdStep = new ToolButton(Stock.MediaNext);

            cmdStep.Clicked += (obj, evt) =>
                               debugPane.DebugView.RunCommand("step");
            cmdStep.Label       = "Step";
            cmdStep.TooltipText = "Step";
            toolBar.Add(cmdStep);
            commandMacros.Add(cmdStep);

            foreach (ToolButton m in commandMacros)
            {
                m.Sensitive = false;
            }

            toolBar.Add(new SeparatorToolItem());

            // Zoom controls
            var zoomIn = new ToolButton(Stock.ZoomIn);

            zoomIn.Clicked    += (obj, evt) => debugPane.PowerView.ZoomIn();
            zoomIn.Label       = "Zoom in";
            zoomIn.TooltipText = "Zoom in";
            toolBar.Add(zoomIn);

            var zoomOut = new ToolButton(Stock.ZoomOut);

            zoomOut.Clicked    += (obj, evt) => debugPane.PowerView.ZoomOut();
            zoomOut.Label       = "Zoom out";
            zoomOut.TooltipText = "Zoom out";
            toolBar.Add(zoomOut);

            var zoomFit = new ToolButton(Stock.ZoomFit);

            zoomFit.Clicked    += (obj, evt) => debugPane.PowerView.ZoomFit();
            zoomFit.Label       = "Zoom fit";
            zoomFit.TooltipText = "Zoom to fit";
            toolBar.Add(zoomFit);

            var zoomFull = new ToolButton(Stock.Zoom100);

            zoomFull.Clicked    += (obj, evt) => debugPane.PowerView.ZoomFull();
            zoomFull.Label       = "Zoom full";
            zoomFull.TooltipText = "Zoom full";
            toolBar.Add(zoomFull);

            // Debug manager listeners
            debugManager.DebuggerBusy    += OnDebuggerBusy;
            debugManager.DebuggerReady   += OnDebuggerReady;
            debugManager.DebuggerStarted += OnDebuggerStarted;
            debugManager.DebuggerExited  += OnDebuggerExited;
        }
Exemplo n.º 10
0
 void OnDebugOutput(object sender, DebugManager.MessageEventArgs args)
 {
     log.AddLine(args.Message.Text);
 }