Debugger - start some disassembler stuff
This commit is contained in:
parent
9a7715009a
commit
15a64b954e
|
@ -44,9 +44,14 @@
|
||||||
this.BreakpointsGroupBox = new System.Windows.Forms.GroupBox();
|
this.BreakpointsGroupBox = new System.Windows.Forms.GroupBox();
|
||||||
this.BreakPointControl1 = new BizHawk.Client.EmuHawk.tools.Debugger.BreakpointControl();
|
this.BreakPointControl1 = new BizHawk.Client.EmuHawk.tools.Debugger.BreakpointControl();
|
||||||
this.DisassemblerBox = new System.Windows.Forms.GroupBox();
|
this.DisassemblerBox = new System.Windows.Forms.GroupBox();
|
||||||
|
this.DisassemblerView = new BizHawk.Client.EmuHawk.VirtualListView();
|
||||||
|
this.Address = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.Instruction = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.RegistersGroupBox.SuspendLayout();
|
this.RegistersGroupBox.SuspendLayout();
|
||||||
this.BreakpointsGroupBox.SuspendLayout();
|
this.BreakpointsGroupBox.SuspendLayout();
|
||||||
|
this.DisassemblerBox.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// menuStrip1
|
// menuStrip1
|
||||||
|
@ -185,6 +190,8 @@
|
||||||
//
|
//
|
||||||
this.DisassemblerBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
this.DisassemblerBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
| System.Windows.Forms.AnchorStyles.Left)));
|
| System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.DisassemblerBox.Controls.Add(this.label1);
|
||||||
|
this.DisassemblerBox.Controls.Add(this.DisassemblerView);
|
||||||
this.DisassemblerBox.Location = new System.Drawing.Point(12, 27);
|
this.DisassemblerBox.Location = new System.Drawing.Point(12, 27);
|
||||||
this.DisassemblerBox.Name = "DisassemblerBox";
|
this.DisassemblerBox.Name = "DisassemblerBox";
|
||||||
this.DisassemblerBox.Size = new System.Drawing.Size(407, 521);
|
this.DisassemblerBox.Size = new System.Drawing.Size(407, 521);
|
||||||
|
@ -192,6 +199,46 @@
|
||||||
this.DisassemblerBox.TabStop = false;
|
this.DisassemblerBox.TabStop = false;
|
||||||
this.DisassemblerBox.Text = "Disassembler";
|
this.DisassemblerBox.Text = "Disassembler";
|
||||||
//
|
//
|
||||||
|
// DisassemblerView
|
||||||
|
//
|
||||||
|
this.DisassemblerView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.DisassemblerView.BlazingFast = false;
|
||||||
|
this.DisassemblerView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||||
|
this.Address,
|
||||||
|
this.Instruction});
|
||||||
|
this.DisassemblerView.GridLines = true;
|
||||||
|
this.DisassemblerView.ItemCount = 0;
|
||||||
|
this.DisassemblerView.Location = new System.Drawing.Point(6, 39);
|
||||||
|
this.DisassemblerView.Name = "DisassemblerView";
|
||||||
|
this.DisassemblerView.SelectAllInProgress = false;
|
||||||
|
this.DisassemblerView.selectedItem = -1;
|
||||||
|
this.DisassemblerView.Size = new System.Drawing.Size(395, 476);
|
||||||
|
this.DisassemblerView.TabIndex = 1;
|
||||||
|
this.DisassemblerView.UseCompatibleStateImageBehavior = false;
|
||||||
|
this.DisassemblerView.UseCustomBackground = true;
|
||||||
|
this.DisassemblerView.View = System.Windows.Forms.View.Details;
|
||||||
|
//
|
||||||
|
// Address
|
||||||
|
//
|
||||||
|
this.Address.Text = "Address";
|
||||||
|
this.Address.Width = 94;
|
||||||
|
//
|
||||||
|
// Instruction
|
||||||
|
//
|
||||||
|
this.Instruction.Text = "Instruction";
|
||||||
|
this.Instruction.Width = 143;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(6, 23);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(29, 13);
|
||||||
|
this.label1.TabIndex = 2;
|
||||||
|
this.label1.Text = "Cpu:";
|
||||||
|
//
|
||||||
// GenericDebugger
|
// GenericDebugger
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -211,6 +258,8 @@
|
||||||
this.menuStrip1.PerformLayout();
|
this.menuStrip1.PerformLayout();
|
||||||
this.RegistersGroupBox.ResumeLayout(false);
|
this.RegistersGroupBox.ResumeLayout(false);
|
||||||
this.BreakpointsGroupBox.ResumeLayout(false);
|
this.BreakpointsGroupBox.ResumeLayout(false);
|
||||||
|
this.DisassemblerBox.ResumeLayout(false);
|
||||||
|
this.DisassemblerBox.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
|
@ -233,5 +282,9 @@
|
||||||
private System.Windows.Forms.GroupBox BreakpointsGroupBox;
|
private System.Windows.Forms.GroupBox BreakpointsGroupBox;
|
||||||
private tools.Debugger.BreakpointControl BreakPointControl1;
|
private tools.Debugger.BreakpointControl BreakPointControl1;
|
||||||
private System.Windows.Forms.GroupBox DisassemblerBox;
|
private System.Windows.Forms.GroupBox DisassemblerBox;
|
||||||
|
private VirtualListView DisassemblerView;
|
||||||
|
private System.Windows.Forms.ColumnHeader Address;
|
||||||
|
private System.Windows.Forms.ColumnHeader Instruction;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -19,12 +19,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private int _defaultHeight;
|
private int _defaultHeight;
|
||||||
|
|
||||||
private IDebuggable Core;
|
private IDebuggable Core;
|
||||||
|
private IDisassemblable Disassembler;
|
||||||
|
|
||||||
public GenericDebugger()
|
public GenericDebugger()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
TopMost = Global.Config.GenericDebuggerSettings.TopMost;
|
TopMost = Global.Config.GenericDebuggerSettings.TopMost;
|
||||||
Closing += (o, e) => DisengageDebugger();
|
Closing += (o, e) => DisengageDebugger();
|
||||||
|
|
||||||
|
DisassemblerView.QueryItemText += DisassemblerView_QueryItemText;
|
||||||
|
DisassemblerView.QueryItemBkColor += DisassemblerView_QueryItemBkColor;
|
||||||
|
DisassemblerView.VirtualMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GenericDebugger_Load(object sender, EventArgs e)
|
private void GenericDebugger_Load(object sender, EventArgs e)
|
||||||
|
@ -51,9 +56,21 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Disassembler = Global.Emulator.AsDissassembler();
|
||||||
|
|
||||||
EngageDebugger();
|
EngageDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DisassemblerView_QueryItemText(int index, int column, out string text)
|
||||||
|
{
|
||||||
|
text = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisassemblerView_QueryItemBkColor(int index, int column, ref Color color)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void DisableRegisterBox()
|
public void DisableRegisterBox()
|
||||||
{
|
{
|
||||||
RegistersGroupBox.Enabled = false;
|
RegistersGroupBox.Enabled = false;
|
||||||
|
@ -61,6 +78,55 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void EngageDebugger()
|
private void EngageDebugger()
|
||||||
{
|
{
|
||||||
|
if (Core.CanDisassemble())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Quick way to check if setting is implemented
|
||||||
|
Disassembler.Cpu = Disassembler.Cpu;
|
||||||
|
|
||||||
|
if (Disassembler.AvailableCpus.Count() > 1)
|
||||||
|
{
|
||||||
|
var c = new ComboBox
|
||||||
|
{
|
||||||
|
Location = new Point(30, 20),
|
||||||
|
DropDownStyle = ComboBoxStyle.DropDownList
|
||||||
|
};
|
||||||
|
|
||||||
|
c.Items.AddRange(Core.AsDissassembler().AvailableCpus.ToArray());
|
||||||
|
|
||||||
|
c.SelectedItem = Core.AsDissassembler().Cpu;
|
||||||
|
|
||||||
|
Controls.Add(c);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisassemblerBox.Controls.Add(new Label
|
||||||
|
{
|
||||||
|
Location = new Point(30, 23),
|
||||||
|
Text = Disassembler.Cpu
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (NotImplementedException)
|
||||||
|
{
|
||||||
|
DisassemblerBox.Controls.Add(new Label
|
||||||
|
{
|
||||||
|
Location = new Point(30, 23),
|
||||||
|
Text = Disassembler.Cpu
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisassemblerBox.Enabled = false;
|
||||||
|
DisassemblerBox.Controls.Add(new Label
|
||||||
|
{
|
||||||
|
Location = new Point(35, 23),
|
||||||
|
Text = "Unknown"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
RegisterPanel.Core = Core;
|
RegisterPanel.Core = Core;
|
||||||
RegisterPanel.ParentDebugger = this;
|
RegisterPanel.ParentDebugger = this;
|
||||||
RegisterPanel.GenerateUI();
|
RegisterPanel.GenerateUI();
|
||||||
|
|
Loading…
Reference in New Issue