diff options
author | Roy Shi <royitaqi@users.noreply.github.com> | 2025-09-23 07:44:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-23 07:44:50 -0700 |
commit | 6007a4dbed2d8867c75bd571e1eb38e10ae14a27 (patch) | |
tree | ec3d68e2b6d01a362e2b29416fb59e69817a2fa4 /llvm/lib/Support/OptimizedStructLayout.cpp | |
parent | 113f01aa82d055410f22a9d03b3468fa68600589 (diff) | |
download | llvm-6007a4dbed2d8867c75bd571e1eb38e10ae14a27.zip llvm-6007a4dbed2d8867c75bd571e1eb38e10ae14a27.tar.gz llvm-6007a4dbed2d8867c75bd571e1eb38e10ae14a27.tar.bz2 |
[vscode-lldb] Restart server when lldb-dap binary has changed (#159797)
# Motiviation
This helps the development of the lldb-dap binary. For example, when
testing a locally built lldb-dap binary, one probably wants to restart
the server after each build in order to use the latest binary. Not doing
so leads to confusion like "why the new lldb-dap isn't doing what I just
changed?".
This patch adds dependency to the `chokidar` package. The reason is that
we need something to detect changes to the `lldb-dap` binary file and
`chokidar` appears to be the most reliable package to do so. An
alternative solution which doesn't require adding dependencies is
discussed below (solution 1).
# Two different solutions considered
Solution 1: Restart server when lldb-dap binary's modification time
changes. https://github.com/llvm/llvm-project/pull/159481 implements
solution 1.
Solution 2: Restart server when lldb-dap binary has changed (as detected
by a file system watcher). This patch implements solution 2 (using
`chokidar`).
# This patch (solution 2)
If the lldb-dap binary has changed, the next time the user start a debug
session, a dialog box will show up and prompt the user to restart the
server. Depend on what has changed, the dialog box will show different
content (see below)
* When both the lldb-dap binary and the arguments have changed:
<img width="520" height="357" alt="diff_args_and_binary"
src="https://github.com/user-attachments/assets/6580e05f-05c3-4d80-8c1a-9c3abf279218"
/>
* When only the lldb-dap binary has changed:
<img width="260" height="384" alt="diff_binary"
src="https://github.com/user-attachments/assets/933b8987-9c21-44f3-ad68-57b8eeb58525"
/>
* When only the arguments have changed (existing):
<img width="520" height="343" alt="diff_args"
src="https://github.com/user-attachments/assets/c0e6771c-ad32-4fb8-b5df-b34cce48ed1a"
/>
Diffstat (limited to 'llvm/lib/Support/OptimizedStructLayout.cpp')
0 files changed, 0 insertions, 0 deletions