Send output to debugger client (#1955)

Sending the output to the debugger client, at the moment only the JS side prints are sent over.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2017-08-30 16:01:06 +02:00
committed by László Langó
parent e897858c64
commit 733f0ceea0
17 changed files with 172 additions and 7 deletions
+30 -6
View File
@@ -26,9 +26,9 @@ 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 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)
for more than one file, right after the engine initialization
(this feature is 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
on a system with much more resources and it should be capable of
storing this information. JerryScript frees all debug information
@@ -206,8 +206,8 @@ jerry_debugger_stop_at_breakpoint (bool enable_stop_at_breakpoint)
**Summary**
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
Stops the engine and puts it into a waiting loop. If the client sends
a source code and JerryScript receives that, then the function will
run the source with the initialized options, after that the engine will
wait for a new source until the client send a close signal.
@@ -232,10 +232,34 @@ jerry_debugger_wait_and_run_client_source (jerry_value_t *return_value)
if (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED)
{
// Handle the fail (e.g. create an error).
// Handle the failure (e.g. create an error).
}
}
jerry_release_value (run_result);
}
while (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVED);
```
### jerry_debugger_send_output
**Summary**
Sends the program's output to the debugger client.
At the moment only the JS print size is implemented.
**Prototype**
```c
void
jerry_debugger_send_output (jerry_char_t buffer[], jerry_size_t string_size, uint8_t type)
```
**Example**
```c
jerry_char_t my_output = "Hey, this should be sent too!";
jerry_size_t my_output_size = sizeof (my_output);
jerry_debugger_send_output (my_output, my_output_size, JERRY_DEBUGGER_OUTPUT_OK);
```