Introduce debugger status flags to control the operation of the debugger. (#1596)

Two issues were fixed as well: inserting breakpoints before non-directive
prologue strings and the receive can process multiple messages.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-02-21 11:57:04 +01:00
committed by GitHub
parent 33138c09f5
commit 00e3de230f
9 changed files with 99 additions and 77 deletions
+9 -5
View File
@@ -2308,11 +2308,13 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
case VM_OC_BREAKPOINT_ENABLED:
{
#ifdef JERRY_DEBUGGER
if (!(JERRY_CONTEXT (jerry_init_flags) & JERRY_INIT_DEBUGGER))
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_IGNORE)
{
continue;
}
JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
frame_ctx_p->byte_code_p = byte_code_start_p;
jerry_debugger_breakpoint_hit ();
@@ -2322,14 +2324,16 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
case VM_OC_BREAKPOINT_DISABLED:
{
#ifdef JERRY_DEBUGGER
if (!(JERRY_CONTEXT (jerry_init_flags) & JERRY_INIT_DEBUGGER))
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_IGNORE)
{
continue;
}
JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
frame_ctx_p->byte_code_p = byte_code_start_p;
if (JERRY_CONTEXT (debugger_stop_exec)
if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP)
&& (JERRY_CONTEXT (debugger_stop_context) == NULL
|| JERRY_CONTEXT (debugger_stop_context) == JERRY_CONTEXT (vm_top_context_p)))
{
@@ -2350,7 +2354,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
continue;
}
if (JERRY_CONTEXT (debugger_stop_exec))
if (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP)
{
JERRY_ASSERT (JERRY_CONTEXT (debugger_stop_context) == NULL);
jerry_debugger_breakpoint_hit ();
@@ -2663,7 +2667,7 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
if (JERRY_CONTEXT (debugger_stop_context) == JERRY_CONTEXT (vm_top_context_p))
{
/* The engine will stop when the next breakpoint is reached. */
JERRY_ASSERT (JERRY_CONTEXT (debugger_stop_exec));
JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP);
JERRY_CONTEXT (debugger_stop_context) = NULL;
}
#endif /* JERRY_DEBUGGER */