Skip to content

Commit 58aa922

Browse files
authored
[lldb-dap] Correcting the types for launch and attach requests. (llvm#137365)
There were a few types that were incorrectly specified in the lldb-dap/package.json. The 'timeout' field was set to 'string' but is interpreted as an integer number of seconds and 'args' for launch is handled as an array of strings, not a single string. Also added a type for the '*Commands' for the items in the arrays.
1 parent 9799746 commit 58aa922

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

lldb/tools/lldb-dap/package.json

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@
189189
},
190190
"args": {
191191
"type": [
192-
"array",
193-
"string"
192+
"array"
194193
],
194+
"items": {
195+
"type": "string"
196+
},
195197
"description": "Program arguments.",
196198
"default": []
197199
},
@@ -293,36 +295,57 @@
293295
},
294296
"initCommands": {
295297
"type": "array",
298+
"items": {
299+
"type": "string"
300+
},
296301
"description": "Initialization commands executed upon debugger startup.",
297302
"default": []
298303
},
299304
"preRunCommands": {
300305
"type": "array",
306+
"items": {
307+
"type": "string"
308+
},
301309
"description": "Commands executed just before the program is launched.",
302310
"default": []
303311
},
304312
"postRunCommands": {
305313
"type": "array",
314+
"items": {
315+
"type": "string"
316+
},
306317
"description": "Commands executed just as soon as the program is successfully launched when it's in a stopped state prior to any automatic continuation.",
307318
"default": []
308319
},
309320
"launchCommands": {
310321
"type": "array",
322+
"items": {
323+
"type": "string"
324+
},
311325
"description": "Custom commands that are executed instead of launching a process. A target will be created with the launch arguments prior to executing these commands. The commands may optionally create a new target and must perform a launch. A valid process must exist after these commands complete or the \"launch\" will fail. Launch the process with \"process launch -s\" to make the process to at the entry point since lldb-dap will auto resume if necessary.",
312326
"default": []
313327
},
314328
"stopCommands": {
315329
"type": "array",
330+
"items": {
331+
"type": "string"
332+
},
316333
"description": "Commands executed each time the program stops.",
317334
"default": []
318335
},
319336
"exitCommands": {
320337
"type": "array",
338+
"items": {
339+
"type": "string"
340+
},
321341
"description": "Commands executed when the program exits.",
322342
"default": []
323343
},
324344
"terminateCommands": {
325345
"type": "array",
346+
"items": {
347+
"type": "string"
348+
},
326349
"description": "Commands executed when the debugging session ends.",
327350
"default": []
328351
},
@@ -332,7 +355,7 @@
332355
"default": false
333356
},
334357
"timeout": {
335-
"type": "string",
358+
"type": "number",
336359
"description": "The time in seconds to wait for a program to stop at entry point when launching with \"launchCommands\". Defaults to 30 seconds."
337360
},
338361
"enableAutoVariableSummaries": {
@@ -449,36 +472,57 @@
449472
},
450473
"attachCommands": {
451474
"type": "array",
475+
"items": {
476+
"type": "string"
477+
},
452478
"description": "Custom commands that are executed instead of attaching to a process ID or to a process by name. These commands may optionally create a new target and must perform an attach. A valid process must exist after these commands complete or the \"attach\" will fail.",
453479
"default": []
454480
},
455481
"initCommands": {
456482
"type": "array",
483+
"items": {
484+
"type": "string"
485+
},
457486
"description": "Initialization commands executed upon debugger startup.",
458487
"default": []
459488
},
460489
"preRunCommands": {
461490
"type": "array",
491+
"items": {
492+
"type": "string"
493+
},
462494
"description": "Commands executed just before the program is attached to.",
463495
"default": []
464496
},
465497
"postRunCommands": {
466498
"type": "array",
499+
"items": {
500+
"type": "string"
501+
},
467502
"description": "Commands executed just as soon as the program is successfully attached when it's in a stopped state prior to any automatic continuation.",
468503
"default": []
469504
},
470505
"stopCommands": {
471506
"type": "array",
507+
"items": {
508+
"type": "string"
509+
},
472510
"description": "Commands executed each time the program stops.",
473511
"default": []
474512
},
475513
"exitCommands": {
476514
"type": "array",
515+
"items": {
516+
"type": "string"
517+
},
477518
"description": "Commands executed when the program exits.",
478519
"default": []
479520
},
480521
"terminateCommands": {
481522
"type": "array",
523+
"items": {
524+
"type": "string"
525+
},
482526
"description": "Commands executed when the debugging session ends.",
483527
"default": []
484528
},
@@ -487,7 +531,7 @@
487531
"description": "Path to the core file to debug."
488532
},
489533
"timeout": {
490-
"type": "string",
534+
"type": "number",
491535
"description": "The time in seconds to wait for a program to stop when attaching using \"attachCommands\". Defaults to 30 seconds."
492536
},
493537
"gdb-remote-port": {

0 commit comments

Comments
 (0)