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
This commit is contained in:
Imre Kiss
2017-08-21 09:19:36 +02:00
committed by László Langó
parent 2888a6f488
commit 3b1d578050
14 changed files with 197 additions and 42 deletions
+15 -7
View File
@@ -26,7 +26,7 @@ can be used for transmitting debugger messages.
The debugger client must be connected to the server before the
JavaScript application runs. On-the-fly attachment is supported
for one file, right after of engine initialization
for more than one file, right after of engine initialization
(this feature available with the python client). The debugging
information (e.g. line index of each possible -breakpoint location)
is not preserved by JerryScript. The client is expected to be run
@@ -208,7 +208,8 @@ jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint)
Stops the engine and puts that into a waiting loop. If the client send
a source code and the JerryScript receive that, then the function will
run the source with the initialized options.
run the source with the initialized options, after that the engine will
wait for a new source until the client send a close signal.
**Prototype**
@@ -222,12 +223,19 @@ jerry_debugger_wait_and_run_client_source (jerry_value_t *return_value)
```c
jerry_init (JERRY_INIT_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
{
// Handle the fail (e.g. create an error).
}
receive_status = jerry_debugger_wait_and_run_client_source (&run_result);
jerry_release_value (wait_and_run_value);
if (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED)
{
// Handle the fail (e.g. create an error).
}
jerry_release_value (run_result);
}
while (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVED);
```