Skip to content

Commit

Permalink
more intuitive debugging support
Browse files Browse the repository at this point in the history
  • Loading branch information
hneemann committed Aug 20, 2016
1 parent 213054b commit 723d4e2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/main/java/de/neemann/assembler/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/de/neemann/assembler/gui/RemoteInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Binary file added src/main/resources/debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 723d4e2

Please sign in to comment.