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
+15 -2
View File
@@ -35,8 +35,8 @@
* debugger versioning.
*/
JERRY_STATIC_ASSERT (JERRY_DEBUGGER_MESSAGES_OUT_MAX_COUNT == 27
&& JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT == 18
&& JERRY_DEBUGGER_VERSION == 1,
&& JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT == 19
&& JERRY_DEBUGGER_VERSION == 2,
debugger_version_correlates_to_message_type_count);
/**
@@ -438,6 +438,19 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer to the rece
return true;
}
case JERRY_DEBUGGER_FINISH:
{
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_VM_STOP);
/* This will point to the current context's parent (where the function was called)
* and in case of NULL the result will the same as in case of STEP. */
JERRY_CONTEXT (debugger_stop_context) = JERRY_CONTEXT (vm_top_context_p->prev_context_p);
*resume_exec_p = true;
return true;
}
case JERRY_DEBUGGER_GET_BACKTRACE:
{
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_get_backtrace_t);
+5 -4
View File
@@ -26,7 +26,7 @@
/**
* JerryScript debugger protocol version.
*/
#define JERRY_DEBUGGER_VERSION (1)
#define JERRY_DEBUGGER_VERSION (2)
/**
* Frequency of calling jerry_debugger_receive() by the VM.
@@ -178,11 +178,12 @@ typedef enum
JERRY_DEBUGGER_CONTINUE = 12, /**< continue execution */
JERRY_DEBUGGER_STEP = 13, /**< next breakpoint, step into functions */
JERRY_DEBUGGER_NEXT = 14, /**< next breakpoint in the same context */
JERRY_DEBUGGER_FINISH = 15, /**< Continue running just after the function in the current stack frame returns */
/* The following messages are only available in breakpoint
* mode and this mode is kept after the message is processed. */
JERRY_DEBUGGER_GET_BACKTRACE = 15, /**< get backtrace */
JERRY_DEBUGGER_EVAL = 16, /**< first message of evaluating a string */
JERRY_DEBUGGER_EVAL_PART = 17, /**< next message of evaluating a string */
JERRY_DEBUGGER_GET_BACKTRACE = 16, /**< get backtrace */
JERRY_DEBUGGER_EVAL = 17, /**< first message of evaluating a string */
JERRY_DEBUGGER_EVAL_PART = 18, /**< next message of evaluating a string */
JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT, /**< number of different type of input messages */
} jerry_debugger_header_type_t;