From f387ea2d822647fb556891c149285a44d5e27467 Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Tue, 27 Jul 2010 04:31:02 +0000 Subject: [PATCH] --- .../Cosmos.Debug.GDB/BreakpointUC.Designer.cs | 80 ++++++++++++ .../Debug/Cosmos.Debug.GDB/BreakpointUC.cs | 16 +++ .../Debug/Cosmos.Debug.GDB/BreakpointUC.resx | 120 ++++++++++++++++++ .../Cosmos.Debug.GDB/Cosmos.Debug.GDB.csproj | 9 ++ .../FormBreakpoints.Designer.cs | 47 ++++--- .../Debug/Cosmos.Debug.GDB/FormBreakpoints.cs | 7 + .../Cosmos.Debug.GDB/FormMain.Designer.cs | 41 +++--- source2/Debug/Cosmos.Debug.GDB/FormMain.cs | 16 ++- 8 files changed, 295 insertions(+), 41 deletions(-) create mode 100644 source2/Debug/Cosmos.Debug.GDB/BreakpointUC.Designer.cs create mode 100644 source2/Debug/Cosmos.Debug.GDB/BreakpointUC.cs create mode 100644 source2/Debug/Cosmos.Debug.GDB/BreakpointUC.resx diff --git a/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.Designer.cs b/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.Designer.cs new file mode 100644 index 000000000..62e8202e0 --- /dev/null +++ b/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.Designer.cs @@ -0,0 +1,80 @@ +namespace Cosmos.Debug.GDB { + partial class BreakpointUC { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.lablNum = new System.Windows.Forms.Label(); + this.cboxEnabled = new System.Windows.Forms.CheckBox(); + this.lablName = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lablNum + // + this.lablNum.AutoSize = true; + this.lablNum.Location = new System.Drawing.Point(24, 4); + this.lablNum.Name = "lablNum"; + this.lablNum.Size = new System.Drawing.Size(28, 13); + this.lablNum.TabIndex = 0; + this.lablNum.Text = "XXX"; + // + // cboxEnabled + // + this.cboxEnabled.AutoSize = true; + this.cboxEnabled.Location = new System.Drawing.Point(3, 3); + this.cboxEnabled.Name = "cboxEnabled"; + this.cboxEnabled.Size = new System.Drawing.Size(15, 14); + this.cboxEnabled.TabIndex = 1; + this.cboxEnabled.UseVisualStyleBackColor = true; + // + // lablName + // + this.lablName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lablName.Location = new System.Drawing.Point(58, 4); + this.lablName.Name = "lablName"; + this.lablName.Size = new System.Drawing.Size(184, 13); + this.lablName.TabIndex = 2; + this.lablName.Text = "Breakpoint Name"; + // + // BreakpointUC + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lablName); + this.Controls.Add(this.cboxEnabled); + this.Controls.Add(this.lablNum); + this.Name = "BreakpointUC"; + this.Size = new System.Drawing.Size(256, 22); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + public System.Windows.Forms.Label lablNum; + public System.Windows.Forms.CheckBox cboxEnabled; + public System.Windows.Forms.Label lablName; + + } +} diff --git a/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.cs b/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.cs new file mode 100644 index 000000000..7d24cfea3 --- /dev/null +++ b/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Cosmos.Debug.GDB { + public partial class BreakpointUC : UserControl { + public BreakpointUC() { + InitializeComponent(); + } + } +} diff --git a/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.resx b/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.resx new file mode 100644 index 000000000..ff31a6db5 --- /dev/null +++ b/source2/Debug/Cosmos.Debug.GDB/BreakpointUC.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/source2/Debug/Cosmos.Debug.GDB/Cosmos.Debug.GDB.csproj b/source2/Debug/Cosmos.Debug.GDB/Cosmos.Debug.GDB.csproj index fe2978fca..1366e70bd 100644 --- a/source2/Debug/Cosmos.Debug.GDB/Cosmos.Debug.GDB.csproj +++ b/source2/Debug/Cosmos.Debug.GDB/Cosmos.Debug.GDB.csproj @@ -72,6 +72,12 @@ + + UserControl + + + BreakpointUC.cs + Form @@ -131,6 +137,9 @@ + + BreakpointUC.cs + FormBreakpoints.cs diff --git a/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.Designer.cs b/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.Designer.cs index 9d463f778..7453aadb0 100644 --- a/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.Designer.cs +++ b/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.Designer.cs @@ -25,26 +25,41 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.lboxBreakpoints = new System.Windows.Forms.ListBox(); + this.menuBreakpoints = new System.Windows.Forms.ContextMenuStrip(this.components); + this.mitmBreakpointDelete = new System.Windows.Forms.ToolStripMenuItem(); this.panel6 = new System.Windows.Forms.Panel(); this.butnBreakpointAdd = new System.Windows.Forms.Button(); this.textBreakpoint = new System.Windows.Forms.TextBox(); - this.menuBreakpoints = new System.Windows.Forms.ContextMenuStrip(this.components); - this.mitmBreakpointDelete = new System.Windows.Forms.ToolStripMenuItem(); - this.panel6.SuspendLayout(); + this.panl = new System.Windows.Forms.Panel(); this.menuBreakpoints.SuspendLayout(); + this.panel6.SuspendLayout(); this.SuspendLayout(); // // lboxBreakpoints // this.lboxBreakpoints.ContextMenuStrip = this.menuBreakpoints; - this.lboxBreakpoints.Dock = System.Windows.Forms.DockStyle.Fill; + this.lboxBreakpoints.Dock = System.Windows.Forms.DockStyle.Top; this.lboxBreakpoints.FormattingEnabled = true; this.lboxBreakpoints.Location = new System.Drawing.Point(0, 32); this.lboxBreakpoints.Name = "lboxBreakpoints"; - this.lboxBreakpoints.Size = new System.Drawing.Size(284, 225); + this.lboxBreakpoints.Size = new System.Drawing.Size(284, 95); this.lboxBreakpoints.Sorted = true; this.lboxBreakpoints.TabIndex = 67; // + // menuBreakpoints + // + this.menuBreakpoints.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mitmBreakpointDelete}); + this.menuBreakpoints.Name = "menuBreakpoints"; + this.menuBreakpoints.Size = new System.Drawing.Size(108, 26); + // + // mitmBreakpointDelete + // + this.mitmBreakpointDelete.Name = "mitmBreakpointDelete"; + this.mitmBreakpointDelete.Size = new System.Drawing.Size(107, 22); + this.mitmBreakpointDelete.Text = "&Delete"; + this.mitmBreakpointDelete.Click += new System.EventHandler(this.mitmBreakpointDelete_Click); + // // panel6 // this.panel6.Controls.Add(this.butnBreakpointAdd); @@ -76,25 +91,20 @@ this.textBreakpoint.TabIndex = 4; this.textBreakpoint.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBreakpoint_KeyPress); // - // menuBreakpoints + // panl // - this.menuBreakpoints.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.mitmBreakpointDelete}); - this.menuBreakpoints.Name = "menuBreakpoints"; - this.menuBreakpoints.Size = new System.Drawing.Size(108, 26); - // - // mitmBreakpointDelete - // - this.mitmBreakpointDelete.Name = "mitmBreakpointDelete"; - this.mitmBreakpointDelete.Size = new System.Drawing.Size(107, 22); - this.mitmBreakpointDelete.Text = "&Delete"; - this.mitmBreakpointDelete.Click += new System.EventHandler(this.mitmBreakpointDelete_Click); + this.panl.Dock = System.Windows.Forms.DockStyle.Fill; + this.panl.Location = new System.Drawing.Point(0, 127); + this.panl.Name = "panl"; + this.panl.Size = new System.Drawing.Size(284, 135); + this.panl.TabIndex = 68; // // FormBreakpoints // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.panl); this.Controls.Add(this.lboxBreakpoints); this.Controls.Add(this.panel6); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; @@ -102,9 +112,9 @@ this.ShowInTaskbar = false; this.Text = "Breakpoints"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormBreakpoints_FormClosing); + this.menuBreakpoints.ResumeLayout(false); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); - this.menuBreakpoints.ResumeLayout(false); this.ResumeLayout(false); } @@ -117,5 +127,6 @@ private System.Windows.Forms.TextBox textBreakpoint; private System.Windows.Forms.ContextMenuStrip menuBreakpoints; private System.Windows.Forms.ToolStripMenuItem mitmBreakpointDelete; + private System.Windows.Forms.Panel panl; } } \ No newline at end of file diff --git a/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.cs b/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.cs index 1ccd90589..2f1f4fabf 100644 --- a/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.cs +++ b/source2/Debug/Cosmos.Debug.GDB/FormBreakpoints.cs @@ -40,6 +40,13 @@ namespace Cosmos.Debug.GDB { var xSplit = xResult[0].Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); if (xSplit[0] == "Breakpoint") { lboxBreakpoints.SelectedIndex = lboxBreakpoints.Items.Add(new Breakpoint(s, int.Parse(xSplit[1]))); + + var xUC = new BreakpointUC(); + xUC.Dock = DockStyle.Top; + xUC.cboxEnabled.Checked = true; + xUC.lablNum.Text = xSplit[1]; + xUC.lablName.Text = s; + panl.Controls.Add(xUC); return true; } MessageBox.Show(xResult[0]); diff --git a/source2/Debug/Cosmos.Debug.GDB/FormMain.Designer.cs b/source2/Debug/Cosmos.Debug.GDB/FormMain.Designer.cs index 5962799a7..ea85e9cc5 100644 --- a/source2/Debug/Cosmos.Debug.GDB/FormMain.Designer.cs +++ b/source2/Debug/Cosmos.Debug.GDB/FormMain.Designer.cs @@ -38,10 +38,10 @@ this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mitmViewBreakpoints = new System.Windows.Forms.ToolStripMenuItem(); this.mitmMainViewCallStack = new System.Windows.Forms.ToolStripMenuItem(); - this.mitmViewLog = new System.Windows.Forms.ToolStripMenuItem(); - this.mitmMainViewWatches = new System.Windows.Forms.ToolStripMenuItem(); this.mitmViewDisassembly = new System.Windows.Forms.ToolStripMenuItem(); + this.mitmViewLog = new System.Windows.Forms.ToolStripMenuItem(); this.mitmRegisters = new System.Windows.Forms.ToolStripMenuItem(); + this.mitmMainViewWatches = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -160,45 +160,45 @@ // mitmViewBreakpoints // this.mitmViewBreakpoints.Name = "mitmViewBreakpoints"; - this.mitmViewBreakpoints.Size = new System.Drawing.Size(152, 22); + this.mitmViewBreakpoints.Size = new System.Drawing.Size(139, 22); this.mitmViewBreakpoints.Text = "&Breakpoints"; this.mitmViewBreakpoints.Click += new System.EventHandler(this.mitmViewBreakpoints_Click); // // mitmMainViewCallStack // this.mitmMainViewCallStack.Name = "mitmMainViewCallStack"; - this.mitmMainViewCallStack.Size = new System.Drawing.Size(152, 22); + this.mitmMainViewCallStack.Size = new System.Drawing.Size(139, 22); this.mitmMainViewCallStack.Text = "&CallStack"; this.mitmMainViewCallStack.Click += new System.EventHandler(this.mitmMainViewCallStack_Click); // - // mitmViewLog - // - this.mitmViewLog.Name = "mitmViewLog"; - this.mitmViewLog.Size = new System.Drawing.Size(152, 22); - this.mitmViewLog.Text = "&Log"; - this.mitmViewLog.Click += new System.EventHandler(this.mitmViewLog_Click); - // - // mitmMainViewWatches - // - this.mitmMainViewWatches.Name = "mitmMainViewWatches"; - this.mitmMainViewWatches.Size = new System.Drawing.Size(152, 22); - this.mitmMainViewWatches.Text = "&Watches"; - this.mitmMainViewWatches.Click += new System.EventHandler(this.mitmMainViewWatches_Click); - // // mitmViewDisassembly // this.mitmViewDisassembly.Name = "mitmViewDisassembly"; - this.mitmViewDisassembly.Size = new System.Drawing.Size(152, 22); + this.mitmViewDisassembly.Size = new System.Drawing.Size(139, 22); this.mitmViewDisassembly.Text = "&Disassembly"; this.mitmViewDisassembly.Click += new System.EventHandler(this.mitmViewDisassembly_Click); // + // mitmViewLog + // + this.mitmViewLog.Name = "mitmViewLog"; + this.mitmViewLog.Size = new System.Drawing.Size(139, 22); + this.mitmViewLog.Text = "&Log"; + this.mitmViewLog.Click += new System.EventHandler(this.mitmViewLog_Click); + // // mitmRegisters // this.mitmRegisters.Name = "mitmRegisters"; - this.mitmRegisters.Size = new System.Drawing.Size(152, 22); + this.mitmRegisters.Size = new System.Drawing.Size(139, 22); this.mitmRegisters.Text = "&Registers"; this.mitmRegisters.Click += new System.EventHandler(this.mitmRegisters_Click); // + // mitmMainViewWatches + // + this.mitmMainViewWatches.Name = "mitmMainViewWatches"; + this.mitmMainViewWatches.Size = new System.Drawing.Size(139, 22); + this.mitmMainViewWatches.Text = "&Watches"; + this.mitmMainViewWatches.Click += new System.EventHandler(this.mitmMainViewWatches_Click); + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -213,6 +213,7 @@ this.Text = "Cosmos GDB Debugger"; this.TopMost = true; this.Load += new System.EventHandler(this.FormMain_Load); + this.Shown += new System.EventHandler(this.FormMain_Shown); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing); this.Resize += new System.EventHandler(this.FormMain_Resize); this.menuStrip1.ResumeLayout(false); diff --git a/source2/Debug/Cosmos.Debug.GDB/FormMain.cs b/source2/Debug/Cosmos.Debug.GDB/FormMain.cs index 95cff2453..6e5fdcc1f 100644 --- a/source2/Debug/Cosmos.Debug.GDB/FormMain.cs +++ b/source2/Debug/Cosmos.Debug.GDB/FormMain.cs @@ -89,9 +89,6 @@ namespace Cosmos.Debug.GDB { private void FormMain_Load(object sender, EventArgs e) { Windows.mMainForm = this; - if (Settings.AutoConnect) { - Connect(30); - } } private void mitmViewBreakpoints_Click(object sender, EventArgs e) { @@ -106,5 +103,18 @@ namespace Cosmos.Debug.GDB { Windows.Show(Windows.mRegistersForm); } + private void FormMain_Shown(object sender, EventArgs e) { + // Dont put this in load. Load happens in main call from Main.cs and on exceptions just + // goes out, no message. + // Also we want to show other forms after main form, not before. + // We also only want to run this once, not on each possible show. + if (mitmConnect.Enabled) { + if (Settings.AutoConnect) { + Connect(30); + } + } + + } + } }