diff options
author | Imre Kiss <kissi@inf.u-szeged.hu> | 2017-08-21 09:19:36 +0200 |
---|---|---|
committer | László Langó <llango.u-szeged@partner.samsung.com> | 2017-08-21 09:19:36 +0200 |
commit | 3b1d5780506e1bb2725934fd7d0dfbb7f4891d89 (patch) | |
tree | a62a41d2b1ce780a367bc5dd74870c19c617f887 /jerry-main | |
parent | 2888a6f4886eec1acbc72ef3f7f8d0af2b8c8323 (diff) |
Multiple client source sending feature. (#1957)
Whit this enhancement the debugger can able handle more than one source file across the new source wait mode.
This feature can be used by the python client with the --client-source [paths] switch.
The client will store every source path, when the debugger send a signal about the waiting status, then the client will send one file from the list.
JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi.szeged@partner.samsung.com
Diffstat (limited to 'jerry-main')
-rw-r--r-- | jerry-main/main-unix.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/jerry-main/main-unix.c b/jerry-main/main-unix.c index 2f749964..5613a3f1 100644 --- a/jerry-main/main-unix.c +++ b/jerry-main/main-unix.c @@ -723,14 +723,28 @@ main (int argc, { is_repl_mode = false; #ifdef JERRY_DEBUGGER - jerry_value_t wait_and_run_value; + jerry_value_t run_result; + jerry_debugger_wait_and_run_type_t receive_status; - if (jerry_debugger_wait_and_run_client_source (&wait_and_run_value) == JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED) + do { - ret_value = jerry_create_error (JERRY_ERROR_COMMON, (jerry_char_t *) "Connection aborted before source arrived."); + receive_status = jerry_debugger_wait_and_run_client_source (&run_result); + + if (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED) + { + ret_value = jerry_create_error (JERRY_ERROR_COMMON, + (jerry_char_t *) "Connection aborted before source arrived."); + } + + if (receive_status == JERRY_DEBUGGER_SOURCE_END) + { + jerry_port_log (JERRY_LOG_LEVEL_DEBUG, "No more client source.\n"); + } + + jerry_release_value (run_result); } + while (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVED); - jerry_release_value (wait_and_run_value); #endif /* JERRY_DEBUGGER */ } |