Add context reset to the debugger.
- The context reset request message can be sent anytime from a client. - After the message received the engine will call the cleanup and init when in the source waiting mode (which means the currently processed file will be executed). - After the reinitialization is done, the engine will wait for a new client connection(rest of the work is the client's responsibility). JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
This commit is contained in:
@@ -586,6 +586,25 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
|
||||
return true;
|
||||
}
|
||||
|
||||
case JERRY_DEBUGGER_CONTEXT_RESET:
|
||||
{
|
||||
if (!(JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CLIENT_SOURCE_MODE))
|
||||
{
|
||||
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Not in client source mode\n");
|
||||
jerry_debugger_close_connection ();
|
||||
return false;
|
||||
}
|
||||
|
||||
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t);
|
||||
|
||||
JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) & ~JERRY_DEBUGGER_CLIENT_SOURCE_MODE);
|
||||
JERRY_CONTEXT (debugger_flags) = (uint8_t) (JERRY_CONTEXT (debugger_flags) | JERRY_DEBUGGER_CONTEXT_RESET_MODE);
|
||||
|
||||
*resume_exec_p = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "Unexpected message.");
|
||||
|
||||
Reference in New Issue
Block a user