microsoft / microsoft/debug-adapter-protocol

Debug protocol: `setVariable` identifies variables by display name

Open
#149 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification
Dominant language
HTML
Stars
1.8k
Forks
173
Avg merge
7d 7h
Merged PRs (30d)
2

Description

From @vadimcn on August 5, 2016 19:43

  • VSCode Version: 1.4
  • OS Version: All

The new setVariable request identifies variables by display name.
This is fragile because the name may have been generated by the adapter (e.g. [N] for array indices).
There may also be more than one variable with the same name in the stack frame in languages that allow variable shadowing. For example, in C++ one can write

int a = 10; 
{ 
    int a = 20;
    ... // There are now two `a`'s here! 

The debugger can see both, even though in C++ there's no way to access the outer one.

To make this work robustly, I would suggest adding an optional "handle" field into Variable, which gets round-tripped back to the adapter in setVariable.

Copied from original issue: Microsoft/vscode#10219

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Variable definition and the setVariable request described in the issue. Define how an optional handle is carried through the protocol and returned to the adapter, then verify that generated display names and shadowed variables can be distinguished.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.