[Lldb-commits] [PATCH] D105166: Fix expression evaluation result expansion in lldb-vscode

jeffrey tan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 29 18:34:19 PDT 2021


yinghuitan created this revision.
yinghuitan added reviewers: clayborg, wallace.
Herald added a subscriber: jfb.
yinghuitan requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

VScode now sends a "scopes" DAP request immediately after any expression evaluation. 
This scopes request would clear and invalidate any non-scoped expandable variables in g_vsc.variables, causing later "variables" request to return empty result.
The symptom is that any expandable variables in VScode watch window/debug console UI to return empty content.

This diff fixes this issue by only clearing the expandable variables at process continue time. To achieve this, we have to repopulate all scoped variables 
during context switch for each "scopes" request without clearing global expandable variables. 
So the PR puts the scoped variables into its own locals/globals/registers; and all expandable variables into separate "expandableVariables" list.
Also, instead of using the variable index for "variableReference", it generates a new variableReference id each time as the key of "expandableVariables".

As a further new feature, this PR adds a new "expandablePermanentVariables" which has the lifetime of debug session. Any expandable variables from debug console
are added into this list. This enables users to snapshot expanable old variable in debug console and compare with new variables if desire.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105166

Files:
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/VSCode.h
  lldb/tools/lldb-vscode/lldb-vscode.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105166.355419.patch
Type: text/x-patch
Size: 15529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210630/c1297608/attachment-0001.bin>


More information about the lldb-commits mailing list