Fix break with no args to list breakpoints instead of printing usage

Previously 'break' / 'bp' with no arguments printed a usage message.
Now it lists active breakpoints, consistent with how monitor commands
are expected to behave when invoked without arguments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
BadvisionandClaude Sonnet 4.6 committed 2026-04-25 17:54:10 +02:00
1 parent 39881bb420
commit 0ca567cecd
2 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -168,7 +168,7 @@ public class MainMode implements TerminalMode {
commandHelp.put("cpu", "Displays the current CPU state (registers and flags).\nUsage: cpu");
commandHelp.put("registers", "Shows or sets CPU register values.\nUsage: registers [reg value]\nExample: registers PC 4000");
commandHelp.put("break", "Manages execution breakpoints.\nUsage: break <addr> | break -<addr> | break clear | break list");
commandHelp.put("break", "Manages execution breakpoints.\nUsage: break - List all active breakpoints\n break <addr> - Add a breakpoint\n break -<addr> - Remove a breakpoint\n break clear - Remove all breakpoints");
commandHelp.put("runto", "Runs the CPU until it reaches the specified address.\nUsage: runto <addr> (or rt <addr>)");
commandHelp.put("run", "Runs the CPU for a specified number of cycles or until a breakpoint is hit.\n" +
+3 -2
View File
@@ -315,7 +315,8 @@ public class MonitorMode implements TerminalMode, WatchCallback {
" reg PC $C000 - Set program counter to $C000\n" +
" reg X 42 - Set X register to decimal 42");
commandHelp.put("break", "Manages breakpoints.\n" +
"Usage: break addr - Add a breakpoint at address\n" +
"Usage: break - List all active breakpoints\n" +
" break addr - Add a breakpoint at address\n" +
" break -addr - Remove a breakpoint at address\n" +
" break clear - Remove all breakpoints");
commandHelp.put("step", "Steps through CPU instructions.\n" +
@@ -459,7 +460,7 @@ public class MonitorMode implements TerminalMode, WatchCallback {
void handleBreakpoint(String[] args) {
if (args.length == 0) {
output.println("Usage: break <address> or break -<address> or break clear");
listBreakpoints();
return;
}