[all-commits] [llvm/llvm-project] 34885b: [lldb-vscode] Handle request_evaluate's context at...

walter erquinigo via All-commits all-commits at lists.llvm.org
Mon Mar 15 15:10:01 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34885bffdf43920c0f011e17a65fd678100240dd
      https://github.com/llvm/llvm-project/commit/34885bffdf43920c0f011e17a65fd678100240dd
  Author: Walter Erquinigo <wallace at fb.com>
  Date:   2021-03-15 (Mon, 15 Mar 2021)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
    A lldb/test/API/tools/lldb-vscode/evaluate/Makefile
    A lldb/test/API/tools/lldb-vscode/evaluate/TestVSCode_evaluate.py
    A lldb/test/API/tools/lldb-vscode/evaluate/foo.cpp
    A lldb/test/API/tools/lldb-vscode/evaluate/foo.h
    A lldb/test/API/tools/lldb-vscode/evaluate/main.cpp
    M lldb/tools/lldb-vscode/lldb-vscode.cpp

  Log Message:
  -----------
  [lldb-vscode] Handle request_evaluate's context attribute

Summary:
The request "evaluate" supports a "context" attribute, which is sent by VSCode. The attribute is defined here https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Evaluate

The "clipboard" context is not yet supported by lldb-vscode, so we can forget about it for now. The 'repl' (i.e. Debug Console) and 'watch' (i.e. Watch Expression) contexts must use the expression parser in case the frame's variable path is not enough, as the user expects these expressions to never fail. On the other hand, the 'hover' expression is invoked whenever the user hovers on any keyword on the UI and the user is fine with the expression not being fully resolved, as they know that the 'repl' case is the fallback they can rely on.

Given that the 'hover' expression is invoked many many times without the user noticing it due to it being triggered by the mouse, I'm making it use only the frame's variable path functionality and not the expression parser. This should speed up tremendously the responsiveness of a debug session when the user only sets source breakpoints and inspect local variables, as the entire debug info is not needed to be parsed.

Regarding tests, I've tried to be as comprehensive as possible considering a multi-file project. Fortunately, the results from the "hover" case are enough most of the times.

Differential Revision: https://reviews.llvm.org/D98656




More information about the All-commits mailing list