Closed HampusAdolfsson closed 5 months ago
@HampusAdolfsson , thanks for raising this issue!
I think the suggested change would make a lot of sense and use this field for what it was designed for. We don't make use of evaluateName
in our debug adapters (yet). Hence, didn't consider it's use so far.
@colin-grant-work , would this agree with the GDB debug adapter that you use?
@HampusAdolfsson , could you please open a PR for this? Happy to test on our end and continue discussion there if need be.
Description When the
CTracker
variable tracker evaluates special expressions to get the address and size of a variable, it uses thename
field to construct the expressions: https://github.com/eclipse-cdt-cloud/vscode-memory-inspector/blob/2bb5658b2a50a2ead3113cfcf63a9b0fb748a70f/src/plugin/adapter-registry/c-tracker.ts#L48-L49It would be more correct to use the
evaluateName
if present, and fall back toname
otherwise. From the DAP specification:This lets debug adapters treat the
name
as more of a "display name" while providing anevaluateName
to use for watch and eval operations. As an example, the IAR debug adapter appends a module name to thename
; a variable calledmyVar
defined inMyFile.c
would have the namemyVar <MyFile\\myVar>
and evaluateNamemyVar
.How to reproduce: Start a session with the IAR debug extension and enable the variables column. Observe that variable sizes have not been resolved, since the
sizeof
expressions have not been evaluated correctly.Any other C debug adapter which distinguishes between
name
andevaluateName
in the same way would work too, but I don't know of any offhand.Environment
Additional information I'd be happy to provide a pull request if you'd like!