When there are variable errors, display an error in VS Code's local variables view.
authorGreg Clayton <gclayton@fb.com>
Wed, 21 Sep 2022 03:58:08 +0000 (20:58 -0700)
committerGreg Clayton <gclayton@fb.com>
Wed, 28 Sep 2022 22:38:02 +0000 (15:38 -0700)
commit15f83ab77502cb2bd405a091cf419536e1d41381
treef82dd8b391f88c275e714e26f3e8d6dd2f4f80df
parent23132508d95cbb3c3fa7aa4b0bebbe021fa5b33f
When there are variable errors, display an error in VS Code's local variables view.

After recent diffs that enable variable errors that stop variables from being correctly displayed when debugging, allow users to see these errors in the LOCALS variables in the VS Code UI. We do this by detecting when no variables are available and when there is an error to be displayed, and we add a single variable named "<error>" whose value is a string error that the user can read. This allows the user to be aware of the reason variables are not available and fix the issue. Previously if someone enabled "-gline-tables-only" or was debugging with DWARF in .o files or with .dwo files and those separate object files were missing or they were out of date, the user would see nothing in the variables view. Communicating these errors to the user is essential to a good debugging experience.

Differential Revision: https://reviews.llvm.org/D134333
lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py
lldb/tools/lldb-vscode/lldb-vscode.cpp