marker for current breakpoint line

This commit is contained in:
Steven Hugg 2018-06-24 13:39:08 -04:00
parent 3bf39dbde5
commit 00537a0e67
2 changed files with 30 additions and 9 deletions

View File

@ -16,13 +16,13 @@ TODO:
- case sensisitvity looking for mismatch variables
- remove pulldown when no preset?
- can't step after reset (or when funky frame; TIA frame is out of sync)
- break on BRK/illegal opcode?
- break on BRK/illegal opcode? (or warnings?)
- skeleton for each platform/tool (check?)
- disassembler/debugger
- multiple breakpoints, expression breakpoints
- current exec. pos in gutter
- cc65: parse listing
- faster Z80 compile
- projects w/ multiple files, navigation (need refactor UI)
- faster Z80 compile (maybe split up files?)
- projects w/ multiple files, navigation (need refactor UI, backend)
- nes: tools (nesst, tiled) https://shiru.untergrund.net/software.shtml

View File

@ -582,13 +582,33 @@ worker.onmessage = function(e) {
setCompileOutput(e.data);
}
function setCurrentLine(line) {
editor.setSelection({line:line,ch:0}, {line:line-1,ch:0}, {scroll:true});
}
var currentDebugLine;
var lastDebugInfo;
var lastDebugState;
function setCurrentLine(line) {
function addCurrentMarker(line) {
var div = document.createElement("div");
div.style.color = '#66ffff'; // TODO
div.appendChild(document.createTextNode("\u25b6"));
editor.setGutterMarker(line, "gutter-info", div);
}
clearCurrentLine();
if (line>0) {
addCurrentMarker(line-1);
editor.setSelection({line:line,ch:0}, {line:line-1,ch:0}, {scroll:true});
currentDebugLine = line;
}
}
function clearCurrentLine() {
if (currentDebugLine) {
editor.clearGutter("gutter-info");
editor.setSelection(editor.getCursor()); // TODO??
currentDebugLine = 0;
}
}
function showMemory(state) {
var s = state && platform.cpuStateToLongString && platform.cpuStateToLongString(state.c);
if (s) {
@ -654,8 +674,9 @@ function _resume() {
function resume() {
clearBreakpoint();
if (! platform.isRunning() )
editor.setSelection(editor.getCursor()); // TODO??
if (! platform.isRunning() ) {
clearCurrentLine();
}
_resume();
userPaused = false;
}