Started working on better breakpoints

This commit is contained in:
Mitchell Plamann
2015-05-03 16:37:15 -04:00
parent 44f10cb5c6
commit 5e0529a1e0
29 changed files with 28 additions and 0 deletions

8
public/vm/c0vm.js Executable file → Normal file
View File

@@ -514,6 +514,14 @@ ProgramState.prototype.set_breakpoint = function(function_index, opcode_index) {
this.breakpoints.push([function_index, opcode_index]);
}
ProgramState.prototype.set_breakpoint_bytecode_line = function(line) {
var indicies = this.file.indicies_for_line(line);
if (indicies === null || indicies.length < 2) {
console.log("Error - indicies_for_line returned an invalid result.");
}
this.set_breakpoint(indicies[0], indicies[1]);
}
ProgramState.prototype.run = function() {
while (true) {
for (var i = 0; i < this.breakpoints.length; i++) {