• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Communication between debugger and VSCode
2Server is an application that accepts commands through the socket and executes them in debugger
3
4Command `ark --debugger --debugger-port=<port_number> --debugger-library-path=<path_to_debugger_library>`  launches debug server
5
6`--debugger-library-path` is an optional parameter
7
8VSCode provides us client interface and sending commands to the debugger with socket
9
10### Description of debug starting process
11Server side
12* Server creates a TCP socket for communication with client
13* Firstly server accepts a test client
14* Secondly server accepts a real client and debug session begins
15
16Client side
17* Client runs a server than waiting for a TCP socket
18* It's critical for VSCode to have a debug server initialized at allocated time so we establish a test connection firstly to check it
19* We create a test client every 100 milliseconds to check is socket ready for a debug session
20* When the connection is established (if it is at the allocated time) test client disconnects and real client connects to server
21* If connection was not established at the allocated time the `Can not launch debug server` error will be thrown
22