Add finish debugger command. (#2240)

With this command the engine continue running just after the function
in the current stack frame returns.

JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
This commit is contained in:
Imre Kiss
2018-03-12 14:42:48 +01:00
committed by László Langó
parent 685af74a10
commit a79c217aa0
9 changed files with 117 additions and 18 deletions
+11 -4
View File
@@ -36,7 +36,7 @@ textarea {
</div>
<script>
// Expected JerryScript debugger protocol version
var JERRY_DEBUGGER_VERSION = 1;
var JERRY_DEBUGGER_VERSION = 2;
// Messages sent by the server to client.
var JERRY_DEBUGGER_CONFIGURATION = 1;
@@ -92,9 +92,10 @@ var JERRY_DEBUGGER_CONTEXT_RESET = 11;
var JERRY_DEBUGGER_CONTINUE = 12;
var JERRY_DEBUGGER_STEP = 13;
var JERRY_DEBUGGER_NEXT = 14;
var JERRY_DEBUGGER_GET_BACKTRACE = 15;
var JERRY_DEBUGGER_EVAL = 16;
var JERRY_DEBUGGER_EVAL_PART = 17;
var JERRY_DEBUGGER_FINISH = 15;
var JERRY_DEBUGGER_GET_BACKTRACE = 16;
var JERRY_DEBUGGER_EVAL = 17;
var JERRY_DEBUGGER_EVAL_PART = 18;
var textBox = document.getElementById("log");
var commandBox = document.getElementById("command");
@@ -1367,6 +1368,7 @@ function debuggerCommand(event)
" continue|c - continue execution\n" +
" step|s - step-in execution\n" +
" next|n - execution until the next breakpoint\n" +
" finish|f - continue running until the current function returns\n" +
" eval|e - evaluate expression\n" +
" backtrace|bt <max-depth> - get backtrace\n" +
" src - print current source code\n" +
@@ -1461,6 +1463,11 @@ function debuggerCommand(event)
debuggerObj.sendResumeExec(JERRY_DEBUGGER_NEXT);
break;
case "f":
case "finish":
debuggerObj.sendResumeExec(JERRY_DEBUGGER_FINISH);
break;
case "e":
case "eval":
debuggerObj.sendEval(args[2]);
+12 -4
View File
@@ -28,7 +28,7 @@ import math
import time
# Expected debugger protocol version.
JERRY_DEBUGGER_VERSION = 1
JERRY_DEBUGGER_VERSION = 2
# Messages sent by the server to client.
JERRY_DEBUGGER_CONFIGURATION = 1
@@ -85,9 +85,10 @@ JERRY_DEBUGGER_CONTEXT_RESET = 11
JERRY_DEBUGGER_CONTINUE = 12
JERRY_DEBUGGER_STEP = 13
JERRY_DEBUGGER_NEXT = 14
JERRY_DEBUGGER_GET_BACKTRACE = 15
JERRY_DEBUGGER_EVAL = 16
JERRY_DEBUGGER_EVAL_PART = 17
JERRY_DEBUGGER_FINISH = 15
JERRY_DEBUGGER_GET_BACKTRACE = 16
JERRY_DEBUGGER_EVAL = 17
JERRY_DEBUGGER_EVAL_PART = 18
MAX_BUFFER_SIZE = 128
WEBSOCKET_BINARY_FRAME = 2
@@ -286,6 +287,13 @@ class DebuggerPrompt(Cmd):
do_n = do_next
def do_finish(self, args):
""" Continue running until the current function returns """
self._exec_command(args, JERRY_DEBUGGER_FINISH)
self.cont = True
do_f = do_finish
def do_list(self, _):
""" Lists the available breakpoints """
if self.debugger.active_breakpoint_list: