Skip to content

Commit

Permalink
Debugger: Label list - Toggle breakpoint on ram labels should create …
Browse files Browse the repository at this point in the history
…RWX breakpoints
  • Loading branch information
SourMesen committed Dec 8, 2024
1 parent d946465 commit 8d49d0e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions UI/Debugger/Breakpoints/BreakpointManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ public static bool EnableDisableBreakpoint(AddressInfo info, CpuType cpuType)
return false;
}

public static void ToggleBreakpoint(AddressInfo info, CpuType cpuType, bool forceExecBreakpoint = true)
public static void ToggleBreakpoint(AddressInfo info, CpuType cpuType)
{
if(info.Address < 0) {
return;
}

Breakpoint? breakpoint = BreakpointManager.GetMatchingForbidBreakpoint(info, cpuType) ?? BreakpointManager.GetMatchingBreakpoint(info, cpuType, forceExecBreakpoint);
Breakpoint? breakpoint = BreakpointManager.GetMatchingForbidBreakpoint(info, cpuType) ?? BreakpointManager.GetMatchingBreakpoint(info, cpuType);
if(breakpoint != null) {
BreakpointManager.RemoveBreakpoint(breakpoint);
} else {
bool execBreakpoint = forceExecBreakpoint || info.Type.IsRomMemory();
bool execBreakpoint = true;
bool readWriteBreakpoint = !info.Type.IsRomMemory() || info.Type.IsRelativeMemory();
if(info.Type.SupportsCdl()) {
CdlFlags cdlData = DebugApi.GetCdlData((uint)info.Address, 1, info.Type)[0];
Expand Down
4 changes: 2 additions & 2 deletions UI/Debugger/ViewModels/EventViewerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private List<ContextMenuAction> GetContextMenuActions()
OnClick = () => {
if(SelectedEvent != null) {
int addr = (int)SelectedEvent.Value.ProgramCounter;
BreakpointManager.ToggleBreakpoint(new AddressInfo() { Address = addr, Type = CpuType.ToMemoryType() }, CpuType, true);
BreakpointManager.ToggleBreakpoint(new AddressInfo() { Address = addr, Type = CpuType.ToMemoryType() }, CpuType);
}
}
},
Expand All @@ -200,7 +200,7 @@ private List<ContextMenuAction> GetContextMenuActions()
OnClick = () => {
if(SelectedEvent?.Flags.HasFlag(EventFlags.ReadWriteOp) == true) {
int addr = (int)SelectedEvent.Value.Operation.Address;
BreakpointManager.ToggleBreakpoint(new AddressInfo() { Address = addr, Type = CpuType.ToMemoryType() }, CpuType, false);
BreakpointManager.ToggleBreakpoint(new AddressInfo() { Address = addr, Type = CpuType.ToMemoryType() }, CpuType);
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion UI/Debugger/ViewModels/LabelListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void InitContextMenu(Control parent)
OnClick = () => {
if(Selection.SelectedItem is LabelViewModel vm) {
AddressInfo addr = vm.Label.GetAbsoluteAddress();
BreakpointManager.ToggleBreakpoint(addr, CpuType, false);
BreakpointManager.ToggleBreakpoint(addr, CpuType);
}
}
},
Expand Down

0 comments on commit 8d49d0e

Please sign in to comment.