Debugger - fix how IMemoryCallbackSystem is used, breakpoint control no longer permanently disabled even when it is implemented in a core
This commit is contained in:
parent
816a6e53df
commit
f79d8332a6
|
@ -15,8 +15,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private IDisassemblable Disassembler { get; set; }
|
private IDisassemblable Disassembler { get; set; }
|
||||||
[OptionalService]
|
[OptionalService]
|
||||||
private IMemoryDomains MemoryDomainSource { get; set; }
|
private IMemoryDomains MemoryDomainSource { get; set; }
|
||||||
[OptionalService]
|
|
||||||
private IMemoryCallbackSystem MCS { get; set; }
|
private IMemoryCallbackSystem MemoryCallbacks { get { return Debuggable.MemoryCallbacks; } }
|
||||||
|
|
||||||
private MemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
private MemoryDomainList MemoryDomains { get { return MemoryDomainSource.MemoryDomains; } }
|
||||||
|
|
||||||
|
@ -28,6 +28,27 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
#region Implementation checking
|
#region Implementation checking
|
||||||
|
|
||||||
|
private bool CanUseMemoryCallbacks
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Debuggable != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = Debuggable.MemoryCallbacks.HasReads;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (NotImplementedException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool CanDisassemble
|
private bool CanDisassemble
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -91,11 +91,18 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RegisterPanel.ParentDebugger = this;
|
RegisterPanel.ParentDebugger = this;
|
||||||
RegisterPanel.GenerateUI();
|
RegisterPanel.GenerateUI();
|
||||||
|
|
||||||
|
if (CanUseMemoryCallbacks)
|
||||||
|
{
|
||||||
BreakPointControl1.Core = Debuggable;
|
BreakPointControl1.Core = Debuggable;
|
||||||
BreakPointControl1.MCS = MCS;
|
BreakPointControl1.MCS = MemoryCallbacks;
|
||||||
BreakPointControl1.ParentDebugger = this;
|
BreakPointControl1.ParentDebugger = this;
|
||||||
BreakPointControl1.MemoryDomains = MemoryDomains;
|
BreakPointControl1.MemoryDomains = MemoryDomains;
|
||||||
BreakPointControl1.GenerateUI();
|
BreakPointControl1.GenerateUI();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisableBreakpointBox();
|
||||||
|
}
|
||||||
|
|
||||||
StepIntoMenuItem.Enabled = StepIntoBtn.Enabled = CanStepInto;
|
StepIntoMenuItem.Enabled = StepIntoBtn.Enabled = CanStepInto;
|
||||||
StepOutMenuItem.Enabled = StepOutBtn.Enabled = CanStepOut;
|
StepOutMenuItem.Enabled = StepOutBtn.Enabled = CanStepOut;
|
||||||
|
|
Loading…
Reference in New Issue