CLDI

The Cloverleaf Debugging Interface (CLDI) defines the interface between Cloverleaf Debugger client and the Tcl/Java Debugger servers. This includes the format of the requests from the client to the server, for example, setting breakpoints. It also includes the information reported in reverse, for example, the stack frames when a breakpoint is hit.

The transport mechanism is a TCP connection between the client and server. When the hcitpstest TPS testing tool starts, the server is listening on a TCP socket, waiting for the client to connect.

The listening port number can be allocated by the operating system or specified with the hcitpstest command-line arguments. The file dbg_port.PID is created in $HCISITEDIR/exec/debugger with the port number as the file contents. PID is the process ID of the hcitpstest process.

The debugging session begins after the TCP connection is established. The listening port is closed, and the dbg_port file is deleted.

When the program stops running because of any stop event, the server reports with information on the current situation. The client can send various debugging commands to the server and receive the response information that is sent back. In this way, you can examine a variables’ values, single step, or set more breakpoints, then resume running the debugger.

Debugging command syntax

From the client to the server, the debugging command syntax is similar to the normal shell command line. This includes a command word and some arguments:

command [arg1 arg2 ...]

Debugging information syntax

From the server to the client, the debugging information is notifications reported when events happen, or responses to the debugging commands. Every notification or response is a JSON object with this format:

{"status": status-string, name1: value1, name2: value2, ...}

The value status-string can be one of:

  • connected
  • started
  • running
  • stopped
  • done
  • ended

For example, when a connection is established, a notification similar to thisis sent by the server:

{"status": "connected", "host": "::1", "port": "46145"}