Debugger: Added option to automatically refresh watch while running
This commit is contained in:
parent
c0c9a47996
commit
410cd90977
4 changed files with 67 additions and 29 deletions
|
@ -145,6 +145,8 @@ namespace Mesen.GUI.Config
|
|||
public bool AutoLoadDbgFiles = false;
|
||||
public bool DisableDefaultLabels = false;
|
||||
|
||||
public bool RefreshWatchWhileRunning = false;
|
||||
|
||||
public bool BreakOnOpen = true;
|
||||
public bool BreakOnReset = true;
|
||||
public bool BreakOnUnofficialOpcodes = true;
|
||||
|
|
|
@ -68,21 +68,33 @@ namespace Mesen.GUI.Debugger
|
|||
|
||||
public void UpdateWatch()
|
||||
{
|
||||
lstWatch.BeginUpdate();
|
||||
lstWatch.Items.Clear();
|
||||
List<WatchValueInfo> watchContent = WatchManager.GetWatchContent(mnuHexDisplay.Checked);
|
||||
|
||||
List<ListViewItem> itemsToAdd = new List<ListViewItem>();
|
||||
foreach(WatchValueInfo watch in WatchManager.GetWatchContent(mnuHexDisplay.Checked)) {
|
||||
ListViewItem item = new ListViewItem(watch.Expression);
|
||||
item.UseItemStyleForSubItems = false;
|
||||
item.SubItems.Add(watch.Value).ForeColor = watch.HasChanged ? Color.Red : Color.Black;
|
||||
itemsToAdd.Add(item);
|
||||
lstWatch.BeginUpdate();
|
||||
|
||||
if(watchContent.Count != lstWatch.Items.Count - 1) {
|
||||
lstWatch.Items.Clear();
|
||||
|
||||
List<ListViewItem> itemsToAdd = new List<ListViewItem>();
|
||||
foreach(WatchValueInfo watch in watchContent) {
|
||||
ListViewItem item = new ListViewItem(watch.Expression);
|
||||
item.UseItemStyleForSubItems = false;
|
||||
item.SubItems.Add(watch.Value).ForeColor = watch.HasChanged ? Color.Red : Color.Black;
|
||||
itemsToAdd.Add(item);
|
||||
}
|
||||
var lastItem = new ListViewItem("");
|
||||
lastItem.SubItems.Add("");
|
||||
itemsToAdd.Add(lastItem);
|
||||
lstWatch.Items.AddRange(itemsToAdd.ToArray());
|
||||
} else {
|
||||
for(int i = 0; i < watchContent.Count; i++) {
|
||||
ListViewItem item = lstWatch.Items[i];
|
||||
item.SubItems[0].Text = watchContent[i].Expression;
|
||||
item.SubItems[1].Text = watchContent[i].Value.ToString();
|
||||
item.SubItems[1].ForeColor = watchContent[i].HasChanged ? Color.Red : Color.Black;
|
||||
}
|
||||
}
|
||||
var lastItem = new ListViewItem("");
|
||||
lastItem.SubItems.Add("");
|
||||
itemsToAdd.Add(lastItem);
|
||||
lstWatch.Items.AddRange(itemsToAdd.ToArray());
|
||||
AdjustColumnWidth();
|
||||
|
||||
lstWatch.EndUpdate();
|
||||
|
||||
if(_currentSelection >= 0 && lstWatch.Items.Count > _currentSelection) {
|
||||
|
|
43
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
43
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
|
@ -140,6 +140,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.lblChrAnalysisResult = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.ctrlPpuMemoryMapping = new Mesen.GUI.Debugger.Controls.ctrlMemoryMapping();
|
||||
this.ctrlCpuMemoryMapping = new Mesen.GUI.Debugger.Controls.ctrlMemoryMapping();
|
||||
this.mnuRefreshWatchWhileRunning = new System.Windows.Forms.ToolStripMenuItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
|
||||
this.splitContainer.Panel1.SuspendLayout();
|
||||
this.splitContainer.Panel2.SuspendLayout();
|
||||
|
@ -208,7 +209,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.ctrlSplitContainerTop.Panel2.Controls.Add(this.tlpFunctionLabelLists);
|
||||
this.ctrlSplitContainerTop.Panel2MinSize = 150;
|
||||
this.ctrlSplitContainerTop.Size = new System.Drawing.Size(1260, 390);
|
||||
this.ctrlSplitContainerTop.SplitterDistance = 879;
|
||||
this.ctrlSplitContainerTop.SplitterDistance = 876;
|
||||
this.ctrlSplitContainerTop.SplitterWidth = 7;
|
||||
this.ctrlSplitContainerTop.TabIndex = 3;
|
||||
this.ctrlSplitContainerTop.PanelCollapsed += new System.EventHandler(this.ctrlSplitContainerTop_PanelCollapsed);
|
||||
|
@ -229,7 +230,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.tlpTop.Name = "tlpTop";
|
||||
this.tlpTop.RowCount = 1;
|
||||
this.tlpTop.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tlpTop.Size = new System.Drawing.Size(879, 390);
|
||||
this.tlpTop.Size = new System.Drawing.Size(876, 390);
|
||||
this.tlpTop.TabIndex = 2;
|
||||
//
|
||||
// ctrlDebuggerCode
|
||||
|
@ -238,7 +239,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.ctrlDebuggerCode.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlDebuggerCode.Location = new System.Drawing.Point(3, 3);
|
||||
this.ctrlDebuggerCode.Name = "ctrlDebuggerCode";
|
||||
this.ctrlDebuggerCode.Size = new System.Drawing.Size(441, 384);
|
||||
this.ctrlDebuggerCode.Size = new System.Drawing.Size(438, 384);
|
||||
this.ctrlDebuggerCode.TabIndex = 2;
|
||||
this.ctrlDebuggerCode.OnEditCode += new Mesen.GUI.Debugger.ctrlDebuggerCode.AssemblerEventHandler(this.ctrlDebuggerCode_OnEditCode);
|
||||
this.ctrlDebuggerCode.OnSetNextStatement += new Mesen.GUI.Debugger.ctrlDebuggerCode.AddressEventHandler(this.ctrlDebuggerCode_OnSetNextStatement);
|
||||
|
@ -247,7 +248,7 @@ namespace Mesen.GUI.Debugger
|
|||
// ctrlConsoleStatus
|
||||
//
|
||||
this.ctrlConsoleStatus.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlConsoleStatus.Location = new System.Drawing.Point(447, 0);
|
||||
this.ctrlConsoleStatus.Location = new System.Drawing.Point(444, 0);
|
||||
this.ctrlConsoleStatus.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.ctrlConsoleStatus.Name = "ctrlConsoleStatus";
|
||||
this.ctrlConsoleStatus.Size = new System.Drawing.Size(432, 390);
|
||||
|
@ -258,7 +259,7 @@ namespace Mesen.GUI.Debugger
|
|||
//
|
||||
this.ctrlDebuggerCodeSplit.Code = null;
|
||||
this.ctrlDebuggerCodeSplit.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlDebuggerCodeSplit.Location = new System.Drawing.Point(450, 3);
|
||||
this.ctrlDebuggerCodeSplit.Location = new System.Drawing.Point(447, 3);
|
||||
this.ctrlDebuggerCodeSplit.Name = "ctrlDebuggerCodeSplit";
|
||||
this.ctrlDebuggerCodeSplit.Size = new System.Drawing.Size(1, 384);
|
||||
this.ctrlDebuggerCodeSplit.TabIndex = 4;
|
||||
|
@ -280,7 +281,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.tlpFunctionLabelLists.RowCount = 2;
|
||||
this.tlpFunctionLabelLists.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tlpFunctionLabelLists.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tlpFunctionLabelLists.Size = new System.Drawing.Size(374, 390);
|
||||
this.tlpFunctionLabelLists.Size = new System.Drawing.Size(377, 390);
|
||||
this.tlpFunctionLabelLists.TabIndex = 5;
|
||||
//
|
||||
// grpLabels
|
||||
|
@ -289,7 +290,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.grpLabels.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.grpLabels.Location = new System.Drawing.Point(3, 198);
|
||||
this.grpLabels.Name = "grpLabels";
|
||||
this.grpLabels.Size = new System.Drawing.Size(368, 189);
|
||||
this.grpLabels.Size = new System.Drawing.Size(371, 189);
|
||||
this.grpLabels.TabIndex = 6;
|
||||
this.grpLabels.TabStop = false;
|
||||
this.grpLabels.Text = "Labels";
|
||||
|
@ -299,7 +300,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.ctrlLabelList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlLabelList.Location = new System.Drawing.Point(3, 16);
|
||||
this.ctrlLabelList.Name = "ctrlLabelList";
|
||||
this.ctrlLabelList.Size = new System.Drawing.Size(362, 170);
|
||||
this.ctrlLabelList.Size = new System.Drawing.Size(365, 170);
|
||||
this.ctrlLabelList.TabIndex = 0;
|
||||
this.ctrlLabelList.OnFindOccurrence += new System.EventHandler(this.ctrlLabelList_OnFindOccurrence);
|
||||
this.ctrlLabelList.OnLabelSelected += new System.EventHandler(this.ctrlLabelList_OnLabelSelected);
|
||||
|
@ -310,7 +311,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.grpFunctions.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.grpFunctions.Location = new System.Drawing.Point(3, 3);
|
||||
this.grpFunctions.Name = "grpFunctions";
|
||||
this.grpFunctions.Size = new System.Drawing.Size(368, 189);
|
||||
this.grpFunctions.Size = new System.Drawing.Size(371, 189);
|
||||
this.grpFunctions.TabIndex = 5;
|
||||
this.grpFunctions.TabStop = false;
|
||||
this.grpFunctions.Text = "Functions";
|
||||
|
@ -320,7 +321,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.ctrlFunctionList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.ctrlFunctionList.Location = new System.Drawing.Point(3, 16);
|
||||
this.ctrlFunctionList.Name = "ctrlFunctionList";
|
||||
this.ctrlFunctionList.Size = new System.Drawing.Size(362, 170);
|
||||
this.ctrlFunctionList.Size = new System.Drawing.Size(365, 170);
|
||||
this.ctrlFunctionList.TabIndex = 0;
|
||||
this.ctrlFunctionList.OnFindOccurrence += new System.EventHandler(this.ctrlFunctionList_OnFindOccurrence);
|
||||
this.ctrlFunctionList.OnFunctionSelected += new System.EventHandler(this.ctrlFunctionList_OnFunctionSelected);
|
||||
|
@ -445,14 +446,14 @@ namespace Mesen.GUI.Debugger
|
|||
//
|
||||
this.mnuSaveRom.Image = global::Mesen.GUI.Properties.Resources.Floppy;
|
||||
this.mnuSaveRom.Name = "mnuSaveRom";
|
||||
this.mnuSaveRom.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuSaveRom.Size = new System.Drawing.Size(151, 22);
|
||||
this.mnuSaveRom.Text = "Save ROM as...";
|
||||
this.mnuSaveRom.Click += new System.EventHandler(this.mnuSaveRom_Click);
|
||||
//
|
||||
// toolStripMenuItem14
|
||||
//
|
||||
this.toolStripMenuItem14.Name = "toolStripMenuItem14";
|
||||
this.toolStripMenuItem14.Size = new System.Drawing.Size(149, 6);
|
||||
this.toolStripMenuItem14.Size = new System.Drawing.Size(148, 6);
|
||||
//
|
||||
// mnuWorkspace
|
||||
//
|
||||
|
@ -463,7 +464,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.mnuAutoLoadDbgFiles,
|
||||
this.mnuDisableDefaultLabels});
|
||||
this.mnuWorkspace.Name = "mnuWorkspace";
|
||||
this.mnuWorkspace.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuWorkspace.Size = new System.Drawing.Size(151, 22);
|
||||
this.mnuWorkspace.Text = "Workspace";
|
||||
//
|
||||
// mnuImportLabels
|
||||
|
@ -506,13 +507,13 @@ namespace Mesen.GUI.Debugger
|
|||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(149, 6);
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(148, 6);
|
||||
//
|
||||
// mnuClose
|
||||
//
|
||||
this.mnuClose.Image = global::Mesen.GUI.Properties.Resources.Exit;
|
||||
this.mnuClose.Name = "mnuClose";
|
||||
this.mnuClose.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuClose.Size = new System.Drawing.Size(151, 22);
|
||||
this.mnuClose.Text = "Close";
|
||||
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
|
||||
//
|
||||
|
@ -769,7 +770,8 @@ namespace Mesen.GUI.Debugger
|
|||
this.mnuShowFunctionLabelLists,
|
||||
this.mnuShowBottomPanel,
|
||||
this.toolStripMenuItem6,
|
||||
this.mnuPpuPartialDraw});
|
||||
this.mnuPpuPartialDraw,
|
||||
this.mnuRefreshWatchWhileRunning});
|
||||
this.mnuOptions.Name = "mnuOptions";
|
||||
this.mnuOptions.Size = new System.Drawing.Size(61, 20);
|
||||
this.mnuOptions.Text = "Options";
|
||||
|
@ -1178,6 +1180,14 @@ namespace Mesen.GUI.Debugger
|
|||
this.ctrlCpuMemoryMapping.Text = "ctrlMemoryMapping1";
|
||||
this.ctrlCpuMemoryMapping.Visible = false;
|
||||
//
|
||||
// mnuRefreshWatchWhileRunning
|
||||
//
|
||||
this.mnuRefreshWatchWhileRunning.CheckOnClick = true;
|
||||
this.mnuRefreshWatchWhileRunning.Name = "mnuRefreshWatchWhileRunning";
|
||||
this.mnuRefreshWatchWhileRunning.Size = new System.Drawing.Size(259, 22);
|
||||
this.mnuRefreshWatchWhileRunning.Text = "Refresh watch while running";
|
||||
this.mnuRefreshWatchWhileRunning.Click += new System.EventHandler(this.mnuRefreshWatchWhileRunning_Click);
|
||||
//
|
||||
// frmDebugger
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -1330,5 +1340,6 @@ namespace Mesen.GUI.Debugger
|
|||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem14;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuAssembler;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuCode;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuRefreshWatchWhileRunning;
|
||||
}
|
||||
}
|
|
@ -65,6 +65,7 @@ namespace Mesen.GUI.Debugger
|
|||
this.mnuDisassembleVerifiedCodeOnly.Checked = ConfigManager.Config.DebugInfo.DisassemblyType == DisassemblyType.VerifiedCode;
|
||||
this.mnuDisassembleEverything.Checked = ConfigManager.Config.DebugInfo.DisassemblyType == DisassemblyType.Everything;
|
||||
this.mnuDisassembleEverythingButData.Checked = ConfigManager.Config.DebugInfo.DisassemblyType == DisassemblyType.EverythingButData;
|
||||
this.mnuRefreshWatchWhileRunning.Checked = ConfigManager.Config.DebugInfo.RefreshWatchWhileRunning;
|
||||
|
||||
if(ConfigManager.Config.DebugInfo.WindowWidth > -1) {
|
||||
this.Width = ConfigManager.Config.DebugInfo.WindowWidth;
|
||||
|
@ -237,6 +238,12 @@ namespace Mesen.GUI.Debugger
|
|||
private void _notifListener_OnNotification(InteropEmu.NotificationEventArgs e)
|
||||
{
|
||||
switch(e.NotificationType) {
|
||||
case InteropEmu.ConsoleNotificationType.PpuFrameDone:
|
||||
if(ConfigManager.Config.DebugInfo.RefreshWatchWhileRunning) {
|
||||
this.BeginInvoke((MethodInvoker)(() => ctrlWatch.UpdateWatch()));
|
||||
}
|
||||
break;
|
||||
|
||||
case InteropEmu.ConsoleNotificationType.CodeBreak:
|
||||
this.BeginInvoke((MethodInvoker)(() => UpdateDebugger()));
|
||||
BreakpointManager.SetBreakpoints();
|
||||
|
@ -693,6 +700,12 @@ namespace Mesen.GUI.Debugger
|
|||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
|
||||
private void mnuRefreshWatchWhileRunning_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConfigManager.Config.DebugInfo.RefreshWatchWhileRunning = mnuRefreshWatchWhileRunning.Checked;
|
||||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
|
||||
private void mnuDisableDefaultLabels_Click(object sender, EventArgs e)
|
||||
{
|
||||
ConfigManager.Config.DebugInfo.DisableDefaultLabels = mnuDisableDefaultLabels.Checked;
|
||||
|
|
Loading…
Add table
Reference in a new issue