<br />

Added: HEAD

## **PROTOCOLS**

## Debug

*Defined in [fuchsia.driver.debug/debug.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=25)*

Protocol for executing interactive driver debug commands.

<br />

### Execute

Executes a command with the provided argument vector.

The argument vector `args` is passed to the driver's command handler
as-is, without in-flight modification. The argument vector follows
standard command-line conventions (analogous to argv), where the first
argument (`args[0]`) is typically the command or subcommand name,
followed by any flags or positional arguments.

Standard output and standard error from command execution are streamed
to the provided `stdout` and `stderr` sockets. The driver or command
handler writes to these sockets and closes them upon or before
returning the response.

Returns the command's process exit code (`exit_code`), where 0
typically denotes success.

## Error

Returns a `zx.Status` error if the execution request itself fails:

- `ZX_ERR_INVALID_ARGS`: `args` is empty.
- `ZX_ERR_NOT_FOUND`: The requested command in `args[0]` is unknown.

#### Request

| Name | Type |
|---|---|
| `args` | `vector<string:1024>:128` |
| `stdout` | `handle<socket>` |
| `stderr` | `handle<socket>` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.driver.debug#Debug_Execute_Result` |

### ListCommands

Lists all supported commands and their descriptions.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.driver.debug#Debug_ListCommands_Result` |

## **STRUCTS**

### Debug_Execute_Response

*Defined in [fuchsia.driver.debug/debug.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=65)*

| Field | Type | Description | Default |
|---|---|---|---|
| `exit_code` | `int32` | The command's exit code, where 0 typically denotes success. | No default |

### Debug_ListCommands_Response

*Defined in [fuchsia.driver.debug/debug.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=71)*

| Field | Type | Description | Default |
|---|---|---|---|
| `commands` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.driver.debug#CommandInfo>:64` |   | No default |

## **TABLES**

### CommandInfo

*Defined in [fuchsia.driver.debug/debug.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=15)*

Metadata for a supported command in the Debug protocol.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `name` | `string:256` | The name of the command. |
| ### 2 | `description` | `string:1024` | A human-readable description of what the command does and its usage. |

## **UNIONS**

### Debug_Execute_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.driver.debug/debug.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=65)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.driver.debug#Debug_Execute_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Debug_ListCommands_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.driver.debug/debug.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=71)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.driver.debug#Debug_ListCommands_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Status` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

## **CONSTANTS**

| Name | Value | Type | Description |
|---|---|---|---|
| [MAX_ARG_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=10) | `128` | `uint32` |   |
| [MAX_ARG_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=9) | `1024` | `uint32` |   |
| [MAX_COMMAND_COUNT](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=12) | `64` | `uint32` |   |
| [MAX_COMMAND_NAME_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=8) | `256` | `uint32` |   |
| [MAX_DESCRIPTION_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.driver.debug/debug.fidl;l=11) | `1024` | `uint32` |   |