@@ -282,12 +282,48 @@ breakpoints such as `b main` and `run` to start debugging as usual with gdb.
282282##### Debugging JavaScript code
283283JerryScript has a built-in remote debugger which allows debugging JavaScript
284284programs. At the moment only a Websocket-based implementation is provided by
285- JerryScript which transmits messages over TCP/IP networks. This implementation
286- requires a socket API which currently only work when running on Linux. The
287- socket API is not yet supported with NewLib when building with Zephyr natively .
285+ JerryScript which transmits messages over TCP/IP networks, but it currently
286+ only supports ethernet, so you'll need to run it on a board that has ethernet
287+ support, for example, the FRDM-K64F or Linux .
288288
289289To enable the remote debugger for a particular JS application:
290290``` bash
291+ make BOARD=frdm_k64f DEBUGGER=on JS=xxx.js
292+ ```
293+
294+ When you flash and run the JS application, it will start in debugging mode,
295+ running on 192.168.1.101:5001, and you will see the following on serial output:
296+
297+ ``` bash
298+ Debugger mode: connect using jerry-client-ws.py
299+
300+ Waiting for client connection
301+ ```
302+ you might need to add a route on your PC to connect to the network if you
303+ are connecting the board directly to your PC:
304+
305+ ``` bash
306+ ip route add 192.168.1/24 dev eno1
307+ ```
308+
309+ Then you can use the jerryscript command line or html client to connect to the
310+ debugger to debug your JS application:
311+
312+ python jerryscript/jerry-debugger/jerry-client-ws.py --display 10 192.168.1.1
313+
314+ In the client, type 'help' to get a list of debugger commands, such as
315+ adding breakpoints, stepping through JS sources, etc.
316+
317+ Alternatively, we've created a client that integrates with Chome DevTools,
318+ which lets you use the Chrome's built-in debugger to connect and you can
319+ use it to set breakpoints and step through source from all within the browser.
320+ Please see installation instructions on how to set it up from
321+ [ here] ( https://github.com/jerryscript-project/jerryscript-debugger-ts )
322+
323+ ##### Debugging JavaScript code on Linux:
324+
325+ To enable the remote debugger on Linux:
326+ ``` bash
291327make BOARD=linux DEBUGGER=on
292328outdir/linux/release/jslinux app.js --debugger
293329```
@@ -296,12 +332,9 @@ It will then be run on debugger mode waiting for client connection, you can then
296332in another terminal, you can connect to it by running the python client in
297333JerryScript:
298334``` bash
299- jerry-debugger/jerry-client-ws.py
335+ python jerryscript/ jerry-debugger/jerry-client-ws.py --display 10 localhost
300336```
301337
302- In the client, type 'help' to get a list of debugger commands, such as
303- adding breakpoints, stepping through JS sources, etc.
304-
305338#### Additional details
306339
307340See below for a few more tips, such as increasing the space available for your
0 commit comments