diff --git a/src/main/java/de/neemann/assembler/gui/Main.java b/src/main/java/de/neemann/assembler/gui/Main.java index 6325c9c..56db2c4 100644 --- a/src/main/java/de/neemann/assembler/gui/Main.java +++ b/src/main/java/de/neemann/assembler/gui/Main.java @@ -198,7 +198,7 @@ public void actionPerformed(ActionEvent actionEvent) { final RemoteInterface remoteInterface = new RemoteInterface(); - ToolTipAction remoteStart = new ToolTipAction("Start", IconCreator.create("media-playback-start.png")) { + ToolTipAction remoteStart = new ToolTipAction("Run", IconCreator.create("media-playback-start.png")) { @Override public void actionPerformed(ActionEvent actionEvent) { try { @@ -213,7 +213,25 @@ public void actionPerformed(ActionEvent actionEvent) { new ErrorMessage("Error").addCause(e).show(Main.this); } } - }.setToolTip("Starts the simulated circuit."); + }.setToolTip("Run the progam."); + + ToolTipAction remoteDebug = new ToolTipAction("Debug", IconCreator.create("debug.png")) { + @Override + public void actionPerformed(ActionEvent actionEvent) { + try { + Program program = createProgram(); + if (program != null) { + writeHex(program, filename); + writeLst(program, filename); + remoteInterface.load(makeFilename(filename, ".asm", ".hex")); + remoteInterface.debug(); + } + } catch (Throwable e) { + new ErrorMessage("Error").addCause(e).show(Main.this); + } + } + }.setToolTip("Debugs the program."); + ToolTipAction remoteRun = new ToolTipAction("Run to BRK", IconCreator.create("media-skip-forward.png")) { @Override public void actionPerformed(ActionEvent actionEvent) { @@ -301,9 +319,11 @@ public void actionPerformed(ActionEvent e) { toolBar.add(build.createJButtonNoText()); toolBar.addSeparator(); toolBar.add(remoteStart.createJButtonNoText()); + toolBar.add(remoteStop.createJButtonNoText()); + toolBar.addSeparator(); + toolBar.add(remoteDebug.createJButtonNoText()); toolBar.add(remoteStep.createJButtonNoText()); toolBar.add(remoteRun.createJButtonNoText()); - toolBar.add(remoteStop.createJButtonNoText()); getContentPane().add(toolBar, BorderLayout.NORTH); pack(); diff --git a/src/main/java/de/neemann/assembler/gui/RemoteInterface.java b/src/main/java/de/neemann/assembler/gui/RemoteInterface.java index b85d01a..e1888e6 100644 --- a/src/main/java/de/neemann/assembler/gui/RemoteInterface.java +++ b/src/main/java/de/neemann/assembler/gui/RemoteInterface.java @@ -33,6 +33,15 @@ public void start() throws RemoteException { sendRequest("start", null); } + /** + * Debugs the simulation + * + * @throws RemoteException RemoteException + */ + public void debug() throws RemoteException { + sendRequest("debug", null); + } + /** * Run to next break point * diff --git a/src/main/resources/debug.png b/src/main/resources/debug.png new file mode 100644 index 0000000..fb1de21 Binary files /dev/null and b/src/main/resources/debug.png differ