Commit 6007a4d
authored
[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. #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"
/>1 parent 113f01a commit 6007a4d
File tree
3 files changed
+81
-13
lines changed- lldb/tools/lldb-dap
- src-ts
3 files changed
+81
-13
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
| |||
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
103 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
104 | 121 | | |
105 | 122 | | |
106 | 123 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 124 | + | |
| 125 | + | |
111 | 126 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
117 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
118 | 135 | | |
119 | 136 | | |
120 | 137 | | |
121 | 138 | | |
122 | 139 | | |
123 | 140 | | |
124 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
125 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
126 | 158 | | |
127 | 159 | | |
128 | 160 | | |
129 | 161 | | |
130 | 162 | | |
131 | 163 | | |
132 | 164 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 165 | + | |
136 | 166 | | |
137 | 167 | | |
138 | 168 | | |
| |||
156 | 186 | | |
157 | 187 | | |
158 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
159 | 193 | | |
160 | 194 | | |
161 | 195 | | |
| |||
0 commit comments