mirror of
https://github.com/openharmony/ark_runtime_core.git
synced 2026-07-18 10:18:07 -04:00
14c9021696
Signed-off-by: wanyanglan <wanyanglan1@huawei.com> Change-Id: I2564094cef9c6c41263e37faf9ffbbec14223dc7
1.2 KiB
1.2 KiB
Communication between debugger and VSCode
Server is an application that receives commands through the socket and executes them in debugger.
Command ark --debugger --debugger-port=<port_number> --debugger-library-path=<path_to_debugger_library> launches debug server.
--debugger-library-path is an optional parameter.
VSCode provides us client interface and sending commands to the debugger with socket.
Description of debug starting process
Server side
- Server creates a TCP socket for communication with client.
- Firstly server accepts a test client.
- Secondly server accepts a real client and debug session begins.
Client side
- Client runs a server other than waiting for a TCP socket.
- It's critical for VSCode to have a debug server initialized at allocated time so we establish a test connection firstly to check it.
- We create a test client every 100 milliseconds to check is socket ready for a debug session.
- When the connection is established (if it is at the allocated time) test client disconnects and real client connects to server.
- If connection was not established at the allocated time the
Can not launch debug servererror will be thrown.