Debugger: Fixed breakpoints not being set correctly from code window when in internal ram section (<= $1FFF)
This commit is contained in:
parent
86ff0cdf2b
commit
a489716ad8
2 changed files with 10 additions and 11 deletions
|
@ -82,10 +82,10 @@ namespace Mesen.GUI.Debugger
|
|||
).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static void ToggleBreakpoint(int relativeAddress, AddressTypeInfo info, bool toggleEnabled)
|
||||
public static void ToggleBreakpoint(AddressTypeInfo info, bool toggleEnabled)
|
||||
{
|
||||
if(relativeAddress >= 0 || info.Address >= 0) {
|
||||
Breakpoint breakpoint = BreakpointManager.GetMatchingBreakpoint(relativeAddress, info);
|
||||
if(info.Address >= 0) {
|
||||
Breakpoint breakpoint = BreakpointManager.GetMatchingBreakpoint(InteropEmu.DebugGetRelativeAddress((uint)info.Address, info.Type), info);
|
||||
if(breakpoint != null) {
|
||||
if(toggleEnabled) {
|
||||
breakpoint.SetEnabled(!breakpoint.Enabled);
|
||||
|
@ -93,13 +93,13 @@ namespace Mesen.GUI.Debugger
|
|||
BreakpointManager.RemoveBreakpoint(breakpoint);
|
||||
}
|
||||
} else {
|
||||
if(info.Address < 0 || info.Type == AddressType.InternalRam) {
|
||||
if(info.Type == AddressType.InternalRam) {
|
||||
breakpoint = new Breakpoint() {
|
||||
MemoryType = DebugMemoryType.CpuMemory,
|
||||
BreakOnExec = true,
|
||||
BreakOnRead = true,
|
||||
BreakOnWrite = true,
|
||||
Address = (UInt32)relativeAddress,
|
||||
Address = (UInt32)info.Address,
|
||||
Enabled = true
|
||||
};
|
||||
} else {
|
||||
|
|
|
@ -298,15 +298,14 @@ namespace Mesen.GUI.Debugger.Controls
|
|||
public void ToggleBreakpoint(bool toggleEnabledFlag)
|
||||
{
|
||||
AddressTypeInfo info = Viewer.GetAddressInfo(Viewer.CodeViewer.SelectedLine);
|
||||
if(info.Address >= 0) {
|
||||
BreakpointManager.ToggleBreakpoint(-1, info, toggleEnabledFlag);
|
||||
} else {
|
||||
if(info.Address < 0) {
|
||||
//Current line has no address, try using the next line instead.
|
||||
//(Used when trying to set a breakpoint on a row containing only a label)
|
||||
info = Viewer.GetAddressInfo(Viewer.CodeViewer.SelectedLine + 1);
|
||||
if(info.Address >= 0) {
|
||||
BreakpointManager.ToggleBreakpoint(-1, info, toggleEnabledFlag);
|
||||
}
|
||||
}
|
||||
|
||||
if(info.Address >= 0) {
|
||||
BreakpointManager.ToggleBreakpoint(info, toggleEnabledFlag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue