Commit 098fb7f
committed
[lldb-dap] Reimplement runInTerminal with signals
runInTerminal is currently implemented using JSON messages over FIFOs,
which feels too clunky for the simple job of passing a PID.
Instead, take advantage of si_pid available from sa_sigaction handler,
and send a user signal instead. Both synchronisation and timeout are
preserved with the protocol below,
1. Debugger waits for SIGUSR1 under timeout with pselect
2. Launcher forks into child, sends SIGUSR1 to debugger and suspends
3. Debugger receives SIGUSR1, captures the sender (launcher child) PID,
attaches to and resumes it
4. Launcher child resumes and exec's into target
5. Launcher parent waitpid's and kills irresponsive child after timeout
With this, the entirety of FifoFiles and RunInTerminal can be dropped.
Refs: llvm#121269 (comment)1 parent bd3c632 commit 098fb7f
File tree
13 files changed
+147
-763
lines changed- lldb
- test/API/tools/lldb-dap/runInTerminal
- tools/lldb-dap
- Handler
- tool
- unittests/DAP
13 files changed
+147
-763
lines changedLines changed: 7 additions & 83 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | | - | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 152 | | |
226 | 153 | | |
227 | 154 | | |
228 | 155 | | |
229 | 156 | | |
230 | | - | |
231 | | - | |
| 157 | + | |
232 | 158 | | |
233 | 159 | | |
234 | 160 | | |
235 | 161 | | |
236 | | - | |
237 | | - | |
| 162 | + | |
| 163 | + | |
238 | 164 | | |
239 | 165 | | |
240 | 166 | | |
| |||
244 | 170 | | |
245 | 171 | | |
246 | 172 | | |
247 | | - | |
248 | | - | |
249 | 173 | | |
250 | | - | |
| 174 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments