Skip to content

Clarify the expected variables start/count behavior #571

Closed

Description

@nd-work

Currently, the specification doesn't describe the expected DAP server behavior when the start or count in the Variables request is out of range.

Some debuggers return an error when the count is greater than the number of available variables, others return fewer variables than requested.

Similarly, different DAP server interpret the namedVariables and indexedVariables fields in the Variable type differently.
Some of them return non-zero variablesReference with a zero namedVariables (indexedVariables is absent).
The non-zero variablesReference suggests that children can be retrieved.
The zero namedVariables suggests that the variable has no children.

Could you please add the expected behavior/contract to the specification?
I believe it will make writing a generic DAP client easier.

Activity

  1. connor4312 commented on Dec 18, 2025

    @connor4312
    Member

    the specification doesn't describe the expected DAP server behavior when the start or count in the Variables request is out of range.

    Because the number of namedVariables is always optional, I agree we can clarify this.

    Some of them return non-zero variablesReference with a zero namedVariables (indexedVariables is absent).
    The non-zero variablesReference suggests that children can be retrieved.
    The zero namedVariables suggests that the variable has no children.

    ...unless indexedVariables is also set. But I would say a server that returns 0 namedVariables if there actually are namedVariables has a bug, it should just omit the property if it doesn't know it.

  2. added a commit that references this issue on Dec 18, 2025
    3fdd089
  3. added a commit that references this issue on Dec 18, 2025
    3a9d1c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

clarification

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions