Fix multiple debugger issues. (#1640)
- Wait for free byte code pointers during garbage collection. - Detect incorrect free requests in the debugger server. - Ignore byte code blocks loaded from snapshot. - Use memmove instead of memcpy to avoid receive buffer corruption. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -2321,6 +2321,20 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
|
||||
JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
|
||||
|
||||
if (frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE)
|
||||
{
|
||||
/* Messages are still processed regardless of ignore. */
|
||||
if (JERRY_CONTEXT (debugger_message_delay) > 0)
|
||||
{
|
||||
JERRY_CONTEXT (debugger_message_delay)--;
|
||||
continue;
|
||||
}
|
||||
|
||||
JERRY_CONTEXT (debugger_message_delay) = JERRY_DEBUGGER_MESSAGE_FREQUENCY;
|
||||
jerry_debugger_receive ();
|
||||
continue;
|
||||
}
|
||||
|
||||
frame_ctx_p->byte_code_p = byte_code_start_p;
|
||||
|
||||
jerry_debugger_breakpoint_hit ();
|
||||
@@ -2337,6 +2351,20 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
|
||||
|
||||
JERRY_ASSERT (JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED);
|
||||
|
||||
if (frame_ctx_p->bytecode_header_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE)
|
||||
{
|
||||
/* Messages are still processed regardless of ignore. */
|
||||
if (JERRY_CONTEXT (debugger_message_delay) > 0)
|
||||
{
|
||||
JERRY_CONTEXT (debugger_message_delay)--;
|
||||
continue;
|
||||
}
|
||||
|
||||
JERRY_CONTEXT (debugger_message_delay) = JERRY_DEBUGGER_MESSAGE_FREQUENCY;
|
||||
jerry_debugger_receive ();
|
||||
continue;
|
||||
}
|
||||
|
||||
frame_ctx_p->byte_code_p = byte_code_start_p;
|
||||
|
||||
if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_VM_STOP)
|
||||
|
||||
Reference in New Issue
Block a user