Debugger/Breakpoints - Add edit and duplicate Breakpoint buttons, refine AddBreakpoint dialog
This commit is contained in:
parent
f8497507f7
commit
7e23b06dd3
|
@ -29,27 +29,28 @@
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
this.AddButton = new System.Windows.Forms.Button();
|
this.AddBtn = new System.Windows.Forms.Button();
|
||||||
this.BreakpointTypeGroupbox = new System.Windows.Forms.GroupBox();
|
this.BreakpointTypeGroupbox = new System.Windows.Forms.GroupBox();
|
||||||
this.ExecuteRadio = new System.Windows.Forms.RadioButton();
|
this.ExecuteRadio = new System.Windows.Forms.RadioButton();
|
||||||
this.WriteRadio = new System.Windows.Forms.RadioButton();
|
this.WriteRadio = new System.Windows.Forms.RadioButton();
|
||||||
this.ReadRadio = new System.Windows.Forms.RadioButton();
|
this.ReadRadio = new System.Windows.Forms.RadioButton();
|
||||||
this.AddressBox = new BizHawk.Client.EmuHawk.HexTextBox();
|
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||||
|
this.CancelBtn = new System.Windows.Forms.Button();
|
||||||
|
this.AddressBox = new BizHawk.Client.EmuHawk.HexTextBox();
|
||||||
this.BreakpointTypeGroupbox.SuspendLayout();
|
this.BreakpointTypeGroupbox.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// AddButton
|
// AddBtn
|
||||||
//
|
//
|
||||||
this.AddButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
this.AddBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.AddButton.Location = new System.Drawing.Point(152, 92);
|
this.AddBtn.Location = new System.Drawing.Point(152, 92);
|
||||||
this.AddButton.Name = "AddButton";
|
this.AddBtn.Name = "AddBtn";
|
||||||
this.AddButton.Size = new System.Drawing.Size(60, 23);
|
this.AddBtn.Size = new System.Drawing.Size(60, 23);
|
||||||
this.AddButton.TabIndex = 100;
|
this.AddBtn.TabIndex = 100;
|
||||||
this.AddButton.Text = "&Add";
|
this.AddBtn.Text = "&Add";
|
||||||
this.AddButton.UseVisualStyleBackColor = true;
|
this.AddBtn.UseVisualStyleBackColor = true;
|
||||||
this.AddButton.Click += new System.EventHandler(this.AddButton_Click);
|
this.AddBtn.Click += new System.EventHandler(this.AddButton_Click);
|
||||||
//
|
//
|
||||||
// BreakpointTypeGroupbox
|
// BreakpointTypeGroupbox
|
||||||
//
|
//
|
||||||
|
@ -94,6 +95,26 @@
|
||||||
this.ReadRadio.Text = "Read";
|
this.ReadRadio.Text = "Read";
|
||||||
this.ReadRadio.UseVisualStyleBackColor = true;
|
this.ReadRadio.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(59, 13);
|
||||||
|
this.label1.TabIndex = 3;
|
||||||
|
this.label1.Text = "Address 0x";
|
||||||
|
//
|
||||||
|
// CancelBtn
|
||||||
|
//
|
||||||
|
this.CancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.CancelBtn.Location = new System.Drawing.Point(83, 92);
|
||||||
|
this.CancelBtn.Name = "CancelBtn";
|
||||||
|
this.CancelBtn.Size = new System.Drawing.Size(60, 23);
|
||||||
|
this.CancelBtn.TabIndex = 101;
|
||||||
|
this.CancelBtn.Text = "&Cancel";
|
||||||
|
this.CancelBtn.UseVisualStyleBackColor = true;
|
||||||
|
this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
|
||||||
|
//
|
||||||
// AddressBox
|
// AddressBox
|
||||||
//
|
//
|
||||||
this.AddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
|
this.AddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
|
||||||
|
@ -104,24 +125,18 @@
|
||||||
this.AddressBox.TabIndex = 1;
|
this.AddressBox.TabIndex = 1;
|
||||||
this.AddressBox.Text = "0";
|
this.AddressBox.Text = "0";
|
||||||
//
|
//
|
||||||
// label1
|
|
||||||
//
|
|
||||||
this.label1.AutoSize = true;
|
|
||||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
|
||||||
this.label1.Name = "label1";
|
|
||||||
this.label1.Size = new System.Drawing.Size(59, 13);
|
|
||||||
this.label1.TabIndex = 3;
|
|
||||||
this.label1.Text = "Address 0x";
|
|
||||||
//
|
|
||||||
// AddBreakpointDialog
|
// AddBreakpointDialog
|
||||||
//
|
//
|
||||||
|
this.AcceptButton = this.AddBtn;
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.CancelButton = this.CancelBtn;
|
||||||
this.ClientSize = new System.Drawing.Size(224, 123);
|
this.ClientSize = new System.Drawing.Size(224, 123);
|
||||||
|
this.Controls.Add(this.CancelBtn);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Controls.Add(this.AddressBox);
|
this.Controls.Add(this.AddressBox);
|
||||||
this.Controls.Add(this.BreakpointTypeGroupbox);
|
this.Controls.Add(this.BreakpointTypeGroupbox);
|
||||||
this.Controls.Add(this.AddButton);
|
this.Controls.Add(this.AddBtn);
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
this.MaximizeBox = false;
|
this.MaximizeBox = false;
|
||||||
this.MinimizeBox = false;
|
this.MinimizeBox = false;
|
||||||
|
@ -139,7 +154,7 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Button AddButton;
|
private System.Windows.Forms.Button AddBtn;
|
||||||
private System.Windows.Forms.GroupBox BreakpointTypeGroupbox;
|
private System.Windows.Forms.GroupBox BreakpointTypeGroupbox;
|
||||||
private System.Windows.Forms.RadioButton ExecuteRadio;
|
private System.Windows.Forms.RadioButton ExecuteRadio;
|
||||||
private System.Windows.Forms.RadioButton WriteRadio;
|
private System.Windows.Forms.RadioButton WriteRadio;
|
||||||
|
@ -147,5 +162,6 @@
|
||||||
private HexTextBox AddressBox;
|
private HexTextBox AddressBox;
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
private System.Windows.Forms.ToolTip toolTip1;
|
private System.Windows.Forms.ToolTip toolTip1;
|
||||||
|
private System.Windows.Forms.Button CancelBtn;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,9 +13,42 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class AddBreakpointDialog : Form
|
public partial class AddBreakpointDialog : Form
|
||||||
{
|
{
|
||||||
public AddBreakpointDialog()
|
public AddBreakpointDialog(BreakpointOperation op)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Operation = op;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddBreakpointDialog(BreakpointOperation op, uint address, MemoryCallbackType type):this(op)
|
||||||
|
{
|
||||||
|
Address = address;
|
||||||
|
BreakType = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BreakpointOperation _operation;
|
||||||
|
|
||||||
|
private BreakpointOperation Operation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _operation;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case BreakpointOperation.Add:
|
||||||
|
Text = "Add Breakpoint";
|
||||||
|
break;
|
||||||
|
case BreakpointOperation.Duplicate:
|
||||||
|
Text = "Duplicate Breakpoint";
|
||||||
|
break;
|
||||||
|
case BreakpointOperation.Edit:
|
||||||
|
Text = "Edit Breakpoint";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_operation = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DisableExecuteOption()
|
public void DisableExecuteOption()
|
||||||
|
@ -50,11 +83,29 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
return MemoryCallbackType.Read;
|
return MemoryCallbackType.Read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ReadRadio.Checked = WriteRadio.Checked = ExecuteRadio.Checked = false;
|
||||||
|
switch (value)
|
||||||
|
{
|
||||||
|
case MemoryCallbackType.Read:
|
||||||
|
ReadRadio.Checked = true;
|
||||||
|
break;
|
||||||
|
case MemoryCallbackType.Write:
|
||||||
|
WriteRadio.Checked = true;
|
||||||
|
break;
|
||||||
|
case MemoryCallbackType.Execute:
|
||||||
|
ExecuteRadio.Checked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint Address
|
public uint Address
|
||||||
{
|
{
|
||||||
get { return (uint)AddressBox.ToRawInt().Value; }
|
get { return (uint)AddressBox.ToRawInt().Value; }
|
||||||
|
set { AddressBox.SetFromLong(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public long MaxAddressSize
|
public long MaxAddressSize
|
||||||
|
@ -63,7 +114,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
return AddressBox.GetMax();
|
return AddressBox.GetMax();
|
||||||
}
|
}
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
AddressBox.SetHexProperties(value);
|
AddressBox.SetHexProperties(value);
|
||||||
|
@ -76,9 +126,21 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CancelBtn_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = DialogResult.Cancel;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
private void AddBreakpointDialog_Load(object sender, EventArgs e)
|
private void AddBreakpointDialog_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum BreakpointOperation
|
||||||
|
{
|
||||||
|
Add, Edit, Duplicate
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,5 +160,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_core.MemoryCallbacks.Remove(Callback);
|
_core.MemoryCallbacks.Remove(Callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetCallback()
|
||||||
|
{
|
||||||
|
if (Active)
|
||||||
|
{
|
||||||
|
RemoveCallback();
|
||||||
|
AddCallback();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,14 @@
|
||||||
this.AddBreakpointButton = new System.Windows.Forms.Button();
|
this.AddBreakpointButton = new System.Windows.Forms.Button();
|
||||||
this.BreakpointStatsLabel = new System.Windows.Forms.Label();
|
this.BreakpointStatsLabel = new System.Windows.Forms.Label();
|
||||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||||
|
this.ToggleButton = new System.Windows.Forms.Button();
|
||||||
|
this.RemoveBreakpointButton = new System.Windows.Forms.Button();
|
||||||
|
this.DuplicateBreakpointButton = new System.Windows.Forms.Button();
|
||||||
|
this.EditBreakpointButton = new System.Windows.Forms.Button();
|
||||||
this.BreakpointView = new BizHawk.Client.EmuHawk.VirtualListView();
|
this.BreakpointView = new BizHawk.Client.EmuHawk.VirtualListView();
|
||||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.ToggleButton = new System.Windows.Forms.Button();
|
|
||||||
this.RemoveBreakpointButton = new System.Windows.Forms.Button();
|
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// AddBreakpointButton
|
// AddBreakpointButton
|
||||||
|
@ -61,6 +63,55 @@
|
||||||
this.BreakpointStatsLabel.TabIndex = 8;
|
this.BreakpointStatsLabel.TabIndex = 8;
|
||||||
this.BreakpointStatsLabel.Text = "label1";
|
this.BreakpointStatsLabel.Text = "label1";
|
||||||
//
|
//
|
||||||
|
// ToggleButton
|
||||||
|
//
|
||||||
|
this.ToggleButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.ToggleButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh;
|
||||||
|
this.ToggleButton.Location = new System.Drawing.Point(138, 387);
|
||||||
|
this.ToggleButton.Name = "ToggleButton";
|
||||||
|
this.ToggleButton.Size = new System.Drawing.Size(23, 23);
|
||||||
|
this.ToggleButton.TabIndex = 9;
|
||||||
|
this.toolTip1.SetToolTip(this.ToggleButton, "Toggle the selected breakpoints");
|
||||||
|
this.ToggleButton.UseVisualStyleBackColor = true;
|
||||||
|
this.ToggleButton.Click += new System.EventHandler(this.ToggleButton_Click);
|
||||||
|
//
|
||||||
|
// RemoveBreakpointButton
|
||||||
|
//
|
||||||
|
this.RemoveBreakpointButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.RemoveBreakpointButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
|
||||||
|
this.RemoveBreakpointButton.Location = new System.Drawing.Point(167, 387);
|
||||||
|
this.RemoveBreakpointButton.Name = "RemoveBreakpointButton";
|
||||||
|
this.RemoveBreakpointButton.Size = new System.Drawing.Size(23, 23);
|
||||||
|
this.RemoveBreakpointButton.TabIndex = 7;
|
||||||
|
this.toolTip1.SetToolTip(this.RemoveBreakpointButton, "Remove selected breakpoints");
|
||||||
|
this.RemoveBreakpointButton.UseVisualStyleBackColor = true;
|
||||||
|
this.RemoveBreakpointButton.Click += new System.EventHandler(this.RemoveBreakpointButton_Click);
|
||||||
|
//
|
||||||
|
// DuplicateBreakpointButton
|
||||||
|
//
|
||||||
|
this.DuplicateBreakpointButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.DuplicateBreakpointButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate;
|
||||||
|
this.DuplicateBreakpointButton.Location = new System.Drawing.Point(109, 387);
|
||||||
|
this.DuplicateBreakpointButton.Name = "DuplicateBreakpointButton";
|
||||||
|
this.DuplicateBreakpointButton.Size = new System.Drawing.Size(23, 23);
|
||||||
|
this.DuplicateBreakpointButton.TabIndex = 10;
|
||||||
|
this.toolTip1.SetToolTip(this.DuplicateBreakpointButton, "Duplicate the selected breakpoint");
|
||||||
|
this.DuplicateBreakpointButton.UseVisualStyleBackColor = true;
|
||||||
|
this.DuplicateBreakpointButton.Click += new System.EventHandler(this.DuplicateBreakpointButton_Click);
|
||||||
|
//
|
||||||
|
// EditBreakpointButton
|
||||||
|
//
|
||||||
|
this.EditBreakpointButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.EditBreakpointButton.BackgroundImage = global::BizHawk.Client.EmuHawk.Properties.Resources.pencil;
|
||||||
|
this.EditBreakpointButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||||
|
this.EditBreakpointButton.Location = new System.Drawing.Point(80, 387);
|
||||||
|
this.EditBreakpointButton.Name = "EditBreakpointButton";
|
||||||
|
this.EditBreakpointButton.Size = new System.Drawing.Size(23, 23);
|
||||||
|
this.EditBreakpointButton.TabIndex = 11;
|
||||||
|
this.toolTip1.SetToolTip(this.EditBreakpointButton, "Edit the selected breakpoint");
|
||||||
|
this.EditBreakpointButton.UseVisualStyleBackColor = true;
|
||||||
|
this.EditBreakpointButton.Click += new System.EventHandler(this.EditBreakpointButton_Click);
|
||||||
|
//
|
||||||
// BreakpointView
|
// BreakpointView
|
||||||
//
|
//
|
||||||
this.BreakpointView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
this.BreakpointView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
@ -106,33 +157,11 @@
|
||||||
this.columnHeader3.Text = "Name";
|
this.columnHeader3.Text = "Name";
|
||||||
this.columnHeader3.Width = 80;
|
this.columnHeader3.Width = 80;
|
||||||
//
|
//
|
||||||
// ToggleButton
|
|
||||||
//
|
|
||||||
this.ToggleButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.ToggleButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh;
|
|
||||||
this.ToggleButton.Location = new System.Drawing.Point(138, 387);
|
|
||||||
this.ToggleButton.Name = "ToggleButton";
|
|
||||||
this.ToggleButton.Size = new System.Drawing.Size(23, 23);
|
|
||||||
this.ToggleButton.TabIndex = 9;
|
|
||||||
this.toolTip1.SetToolTip(this.ToggleButton, "Toggle the selected breakpoints");
|
|
||||||
this.ToggleButton.UseVisualStyleBackColor = true;
|
|
||||||
this.ToggleButton.Click += new System.EventHandler(this.ToggleButton_Click);
|
|
||||||
//
|
|
||||||
// RemoveBreakpointButton
|
|
||||||
//
|
|
||||||
this.RemoveBreakpointButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.RemoveBreakpointButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
|
|
||||||
this.RemoveBreakpointButton.Location = new System.Drawing.Point(167, 387);
|
|
||||||
this.RemoveBreakpointButton.Name = "RemoveBreakpointButton";
|
|
||||||
this.RemoveBreakpointButton.Size = new System.Drawing.Size(23, 23);
|
|
||||||
this.RemoveBreakpointButton.TabIndex = 7;
|
|
||||||
this.toolTip1.SetToolTip(this.RemoveBreakpointButton, "Remove selected breakpoints");
|
|
||||||
this.RemoveBreakpointButton.UseVisualStyleBackColor = true;
|
|
||||||
this.RemoveBreakpointButton.Click += new System.EventHandler(this.RemoveBreakpointButton_Click);
|
|
||||||
//
|
|
||||||
// BreakpointControl
|
// BreakpointControl
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||||
|
this.Controls.Add(this.EditBreakpointButton);
|
||||||
|
this.Controls.Add(this.DuplicateBreakpointButton);
|
||||||
this.Controls.Add(this.ToggleButton);
|
this.Controls.Add(this.ToggleButton);
|
||||||
this.Controls.Add(this.BreakpointStatsLabel);
|
this.Controls.Add(this.BreakpointStatsLabel);
|
||||||
this.Controls.Add(this.RemoveBreakpointButton);
|
this.Controls.Add(this.RemoveBreakpointButton);
|
||||||
|
@ -157,5 +186,7 @@
|
||||||
private System.Windows.Forms.Label BreakpointStatsLabel;
|
private System.Windows.Forms.Label BreakpointStatsLabel;
|
||||||
private System.Windows.Forms.ToolTip toolTip1;
|
private System.Windows.Forms.ToolTip toolTip1;
|
||||||
private System.Windows.Forms.Button ToggleButton;
|
private System.Windows.Forms.Button ToggleButton;
|
||||||
|
private System.Windows.Forms.Button DuplicateBreakpointButton;
|
||||||
|
private System.Windows.Forms.Button EditBreakpointButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,16 +154,7 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
||||||
|
|
||||||
private void AddBreakpointButton_Click(object sender, EventArgs e)
|
private void AddBreakpointButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var b = new AddBreakpointDialog
|
var b = CreateAddBreakpointDialog(BreakpointOperation.Add);
|
||||||
{
|
|
||||||
// TODO: don't use Global.Emulator! Pass in an IMemoryDomains implementation from the parent tool
|
|
||||||
MaxAddressSize = Global.Emulator.AsMemoryDomains().SystemBus.Size - 1
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!MCS.ExecuteCallbacksAvailable)
|
|
||||||
{
|
|
||||||
b.DisableExecuteOption();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (b.ShowHawkDialog() == DialogResult.OK)
|
if (b.ShowHawkDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
@ -233,6 +224,10 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
||||||
ToggleButton.Enabled =
|
ToggleButton.Enabled =
|
||||||
RemoveBreakpointButton.Enabled =
|
RemoveBreakpointButton.Enabled =
|
||||||
EditableItems.Any();
|
EditableItems.Any();
|
||||||
|
|
||||||
|
DuplicateBreakpointButton.Enabled =
|
||||||
|
EditBreakpointButton.Enabled =
|
||||||
|
EditableItems.Count() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BreakpointView_SelectedIndexChanged(object sender, EventArgs e)
|
private void BreakpointView_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
@ -282,5 +277,78 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
|
||||||
BreakpointView.ItemCount = Breakpoints.Count;
|
BreakpointView.ItemCount = Breakpoints.Count;
|
||||||
UpdateStatsLabel();
|
UpdateStatsLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DuplicateBreakpointButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var breakpoint = SelectedItems.FirstOrDefault();
|
||||||
|
|
||||||
|
if (breakpoint != null && !breakpoint.ReadOnly)
|
||||||
|
{
|
||||||
|
var b = CreateAddBreakpointDialog(BreakpointOperation.Duplicate, breakpoint.Type, breakpoint.Address);
|
||||||
|
|
||||||
|
if (b.ShowHawkDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
Breakpoints.Add(new Breakpoint(Core, breakpoint.Callback, b.Address, b.BreakType, breakpoint.Active));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BreakpointView.ItemCount = Breakpoints.Count;
|
||||||
|
UpdateBreakpointRemoveButton();
|
||||||
|
UpdateStatsLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EditBreakpointButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var breakpoint = SelectedItems.FirstOrDefault();
|
||||||
|
|
||||||
|
if (breakpoint != null && !breakpoint.ReadOnly)
|
||||||
|
{
|
||||||
|
var b = CreateAddBreakpointDialog(BreakpointOperation.Edit, breakpoint.Type, breakpoint.Address);
|
||||||
|
|
||||||
|
if (b.ShowHawkDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
breakpoint.Type = b.BreakType;
|
||||||
|
breakpoint.Address = b.Address;
|
||||||
|
breakpoint.ResetCallback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BreakpointView.ItemCount = Breakpoints.Count;
|
||||||
|
UpdateBreakpointRemoveButton();
|
||||||
|
UpdateStatsLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private AddBreakpointDialog CreateAddBreakpointDialog(BreakpointOperation op, MemoryCallbackType? type = null, uint? address = null)
|
||||||
|
{
|
||||||
|
var operation = (AddBreakpointDialog.BreakpointOperation)op;
|
||||||
|
|
||||||
|
var b = new AddBreakpointDialog(operation)
|
||||||
|
{
|
||||||
|
// TODO: don't use Global.Emulator! Pass in an IMemoryDomains implementation from the parent tool
|
||||||
|
MaxAddressSize = Global.Emulator.AsMemoryDomains().SystemBus.Size - 1
|
||||||
|
};
|
||||||
|
|
||||||
|
if (type != null)
|
||||||
|
{
|
||||||
|
b.BreakType = (MemoryCallbackType)type;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (address != null)
|
||||||
|
{
|
||||||
|
b.Address = (uint)address;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!MCS.ExecuteCallbacksAvailable)
|
||||||
|
{
|
||||||
|
b.DisableExecuteOption();
|
||||||
|
}
|
||||||
|
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum BreakpointOperation
|
||||||
|
{
|
||||||
|
Add, Edit, Duplicate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue