Skip to content

[lldb-dap] Correcting the types for launch and attach requests. #137365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

ashgti
Copy link
Contributor

@ashgti ashgti commented Apr 25, 2025

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.

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.
@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2025

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/137365.diff

1 Files Affected:

  • (modified) lldb/tools/lldb-dap/package.json (+48-4)
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index c339178cbc126..3957e3f27f297 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -189,9 +189,11 @@
               },
               "args": {
                 "type": [
-                  "array",
-                  "string"
+                  "array"
                 ],
+                "items": {
+                  "type": "string"
+                },
                 "description": "Program arguments.",
                 "default": []
               },
@@ -293,36 +295,57 @@
               },
               "initCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Initialization commands executed upon debugger startup.",
                 "default": []
               },
               "preRunCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed just before the program is launched.",
                 "default": []
               },
               "postRunCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed just as soon as the program is successfully launched when it's in a stopped state prior to any automatic continuation.",
                 "default": []
               },
               "launchCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "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.",
                 "default": []
               },
               "stopCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed each time the program stops.",
                 "default": []
               },
               "exitCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed when the program exits.",
                 "default": []
               },
               "terminateCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed when the debugging session ends.",
                 "default": []
               },
@@ -332,7 +355,7 @@
                 "default": false
               },
               "timeout": {
-                "type": "string",
+                "type": "number",
                 "description": "The time in seconds to wait for a program to stop at entry point when launching with \"launchCommands\". Defaults to 30 seconds."
               },
               "enableAutoVariableSummaries": {
@@ -449,36 +472,57 @@
               },
               "attachCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "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.",
                 "default": []
               },
               "initCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Initialization commands executed upon debugger startup.",
                 "default": []
               },
               "preRunCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed just before the program is attached to.",
                 "default": []
               },
               "postRunCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed just as soon as the program is successfully attached when it's in a stopped state prior to any automatic continuation.",
                 "default": []
               },
               "stopCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed each time the program stops.",
                 "default": []
               },
               "exitCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed when the program exits.",
                 "default": []
               },
               "terminateCommands": {
                 "type": "array",
+                "items": {
+                  "type": "string"
+                },
                 "description": "Commands executed when the debugging session ends.",
                 "default": []
               },
@@ -487,7 +531,7 @@
                 "description": "Path to the core file to debug."
               },
               "timeout": {
-                "type": "string",
+                "type": "number",
                 "description": "The time in seconds to wait for a program to stop when attaching using \"attachCommands\". Defaults to 30 seconds."
               },
               "gdb-remote-port": {

@ashgti ashgti merged commit 58aa922 into llvm:main Apr 25, 2025
11 of 13 checks passed
jyli0116 pushed a commit to jyli0116/llvm-project that referenced this pull request Apr 28, 2025
…#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.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…#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.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…#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.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…#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.
@ashgti ashgti deleted the lldb-dap-package branch May 7, 2025 17:37
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants