Esempio n. 1
0
        private void ViewContext_Click(object sender, EventArgs e)
        {
            var dock = new ContextContent();

            DebuggerUI.DockContents.Add(dock);
            DebuggerUI.UpdateContextDataSources();
            dock.Show(this.dockPanel, DockState.Float);
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();
            DebuggerUI.MainForm = this;
            this.IsMdiContainer = true;
            this.Width          = 1500;

            var menu = new MainMenu();

            this.Menu = menu;
            var server = new MenuItem("Server");

            menu.MenuItems.Add(server);
            var connect = new MenuItem("Connect");

            connect.Click += Connect_Click;
            var getProgram = new MenuItem("Get Program");

            server.MenuItems.Add(connect);
            server.MenuItems.Add(getProgram);
            getProgram.Click += GetProgram_Click;

            var view = new MenuItem("View");

            menu.MenuItems.Add(view);

            var viewOutput = new MenuItem("Debug Output");

            view.MenuItems.Add(viewOutput);
            viewOutput.Click += ViewOutput_Click;


            var viewStrings = new MenuItem("String Table");

            view.MenuItems.Add(viewStrings);
            viewStrings.Click += ViewStrings_Click;

            var viewMachine = new MenuItem("Machine Tree");

            view.MenuItems.Add(viewMachine);
            viewMachine.Click += ViewMachine_Click;

            var viewContext = new MenuItem("Context");

            view.MenuItems.Add(viewContext);
            viewContext.Click += ViewContext_Click;

            var debug = new MenuItem("Debug");

            menu.MenuItems.Add(debug);
            var run = new MenuItem("Run");

            run.Shortcut = Shortcut.F5;
            debug.MenuItems.Add(run);
            run.Click += Run_Click;

            var stepInto = new MenuItem("Step Into");

            stepInto.Shortcut = Shortcut.F11;
            debug.MenuItems.Add(stepInto);
            stepInto.Click += StepInto_Click;

            var stepOver = new MenuItem("Step Over");

            stepOver.Shortcut = Shortcut.F10;
            debug.MenuItems.Add(stepOver);
            stepOver.Click += StepOver_Click;

            var stepOut = new MenuItem("Step Out");

            stepOut.Shortcut = Shortcut.ShiftF11;
            debug.MenuItems.Add(stepOut);
            stepOut.Click += StepOut_Click;

            this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            this.Controls.Add(this.dockPanel);
            var grid = new DisassemblyGridContent();

            grid.Show(this.dockPanel, DockState.DockLeft);
            var context = new ContextContent();

            context.Show(this.dockPanel, DockState.Document);
            var tree = new MachineTreeContent();

            tree.Show(this.dockPanel, DockState.DockRight);

            var output = new DebugOutputContent();

            output.Show(this.dockPanel, DockState.Document);
            //this.WindowState = FormWindowState.Maximized;
            this.dockPanel.DockLeftPortion = 0.3;
            DebuggerUI.DockContents.Add(grid);
            DebuggerUI.DockContents.Add(context);
            DebuggerUI.DockContents.Add(output);
            DebuggerUI.DockContents.Add(tree);
            DebuggerUI.UpdateContextDataSources();
            DebuggerUI.ZMB.DataArrived += _mb_DataArrived;
            DebuggerUI.ZMB.SetIdentity("__DEBUG__");
            DebuggerUI.ZMB.Connect("tcp://localhost:5560");
            Thread.Sleep(500);
            DebuggerUI.ZMB.GetProgramData();
        }