Skip to content

[lldb-dap] Fix package.json after a bad merge. #138918

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
May 7, 2025

Conversation

ashgti
Copy link
Contributor

@ashgti ashgti commented May 7, 2025

The package.json is currently malformed after a bad merge in 39e6e88.

@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

Changes

The package.json was broken by a bad merge in 39e6e88.

I also ran npm run format to format the typecript files.


Patch is 57.25 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/138918.diff

3 Files Affected:

  • (modified) lldb/tools/lldb-dap/package.json (+490-490)
  • (modified) lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts (+57-39)
  • (modified) lldb/tools/lldb-dap/src-ts/uri-launch-handler.ts (+96-72)
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index 4734c9d7277bb..2be45d6dcdfe7 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -242,527 +242,527 @@
           }
         }
       }
-    ]
-  },
-  "breakpoints": [
-    {
-      "language": "ada"
-    },
-    {
-      "language": "arm"
-    },
-    {
-      "language": "asm"
-    },
-    {
-      "language": "c"
-    },
-    {
-      "language": "cpp"
-    },
-    {
-      "language": "crystal"
-    },
-    {
-      "language": "d"
-    },
-    {
-      "language": "fortan"
-    },
-    {
-      "language": "fortran-modern"
-    },
-    {
-      "language": "nim"
-    },
-    {
-      "language": "objective-c"
-    },
-    {
-      "language": "objectpascal"
-    },
-    {
-      "language": "pascal"
-    },
-    {
-      "language": "rust"
-    },
-    {
-      "language": "swift"
-    }
-  ],
-  "debuggers": [
-    {
-      "type": "lldb-dap",
-      "label": "LLDB DAP Debugger",
-      "configurationAttributes": {
-        "launch": {
-          "required": [
-            "program"
-          ],
-          "properties": {
-            "debugAdapterHostname": {
-              "type": "string",
-              "markdownDescription": "The hostname that an existing lldb-dap executable is listening on."
-            },
-            "debugAdapterPort": {
-              "type": "number",
-              "markdownDescription": "The port that an existing lldb-dap executable is listening on."
-            },
-            "debugAdapterExecutable": {
-              "type": "string",
-              "markdownDescription": "The absolute path to the LLDB debug adapter executable to use. Overrides any user or workspace settings."
-            },
-            "debugAdapterArgs": {
-              "type": "array",
-              "items": {
-                "type": "string"
+    ],
+    "breakpoints": [
+      {
+        "language": "ada"
+      },
+      {
+        "language": "arm"
+      },
+      {
+        "language": "asm"
+      },
+      {
+        "language": "c"
+      },
+      {
+        "language": "cpp"
+      },
+      {
+        "language": "crystal"
+      },
+      {
+        "language": "d"
+      },
+      {
+        "language": "fortan"
+      },
+      {
+        "language": "fortran-modern"
+      },
+      {
+        "language": "nim"
+      },
+      {
+        "language": "objective-c"
+      },
+      {
+        "language": "objectpascal"
+      },
+      {
+        "language": "pascal"
+      },
+      {
+        "language": "rust"
+      },
+      {
+        "language": "swift"
+      }
+    ],
+    "debuggers": [
+      {
+        "type": "lldb-dap",
+        "label": "LLDB DAP Debugger",
+        "configurationAttributes": {
+          "launch": {
+            "required": [
+              "program"
+            ],
+            "properties": {
+              "debugAdapterHostname": {
+                "type": "string",
+                "markdownDescription": "The hostname that an existing lldb-dap executable is listening on."
               },
-              "markdownDescription": "The list of additional arguments used to launch the debug adapter executable. Overrides any user or workspace settings."
-            },
-            "program": {
-              "type": "string",
-              "description": "Path to the program to debug."
-            },
-            "args": {
-              "type": [
-                "array"
-              ],
-              "items": {
-                "type": "string"
-              },
-              "description": "Program arguments.",
-              "default": []
-            },
-            "cwd": {
-              "type": "string",
-              "description": "Program working directory.",
-              "default": "${workspaceRoot}"
-            },
-            "env": {
-              "anyOf": [
-                {
-                  "type": "object",
-                  "description": "Additional environment variables to set when launching the program. E.g. `{ \"FOO\": \"1\" }`",
-                  "patternProperties": {
-                    ".*": {
-                      "type": "string"
-                    }
-                  },
-                  "default": {}
+              "debugAdapterPort": {
+                "type": "number",
+                "markdownDescription": "The port that an existing lldb-dap executable is listening on."
+              },
+              "debugAdapterExecutable": {
+                "type": "string",
+                "markdownDescription": "The absolute path to the LLDB debug adapter executable to use. Overrides any user or workspace settings."
+              },
+              "debugAdapterArgs": {
+                "type": "array",
+                "items": {
+                  "type": "string"
                 },
-                {
-                  "type": "array",
-                  "description": "Additional environment variables to set when launching the program. E.g. `[\"FOO=1\", \"BAR\"]`",
-                  "items": {
-                    "type": "string",
-                    "pattern": "^((\\w+=.*)|^\\w+)$"
-                  },
-                  "default": []
-                }
-              ]
-            },
-            "stopOnEntry": {
-              "type": "boolean",
-              "description": "Automatically stop after launch.",
-              "default": false
-            },
-            "disableASLR": {
-              "type": "boolean",
-              "description": "Enable or disable Address space layout randomization if the debugger supports it.",
-              "default": true
-            },
-            "disableSTDIO": {
-              "type": "boolean",
-              "description": "Don't retrieve STDIN, STDOUT and STDERR as the program is running.",
-              "default": false
-            },
-            "shellExpandArguments": {
-              "type": "boolean",
-              "description": "Expand program arguments as a shell would without actually launching the program in a shell.",
-              "default": false
-            },
-            "detachOnError": {
-              "type": "boolean",
-              "description": "Detach from the program.",
-              "default": false
-            },
-            "sourcePath": {
-              "type": "string",
-              "description": "Specify a source path to remap \"./\" to allow full paths to be used when setting breakpoints in binaries that have relative source paths."
-            },
-            "sourceMap": {
-              "anyOf": [
-                {
-                  "type": "object",
-                  "description": "Specify an object of path remappings; each entry has a key containing the source path and a value containing the destination path. E.g `{ \"/the/source/path\": \"/the/destination/path\" }`. Overrides sourcePath.",
-                  "patternProperties": {
-                    ".*": {
-                      "type": "string"
-                    }
-                  },
-                  "default": {}
+                "markdownDescription": "The list of additional arguments used to launch the debug adapter executable. Overrides any user or workspace settings."
+              },
+              "program": {
+                "type": "string",
+                "description": "Path to the program to debug."
+              },
+              "args": {
+                "type": [
+                  "array"
+                ],
+                "items": {
+                  "type": "string"
                 },
-                {
-                  "type": "array",
-                  "description": "Specify an array of path remappings; each element must itself be a two element array containing a source and destination path name. Overrides sourcePath.",
-                  "items": {
+                "description": "Program arguments.",
+                "default": []
+              },
+              "cwd": {
+                "type": "string",
+                "description": "Program working directory.",
+                "default": "${workspaceRoot}"
+              },
+              "env": {
+                "anyOf": [
+                  {
+                    "type": "object",
+                    "description": "Additional environment variables to set when launching the program. E.g. `{ \"FOO\": \"1\" }`",
+                    "patternProperties": {
+                      ".*": {
+                        "type": "string"
+                      }
+                    },
+                    "default": {}
+                  },
+                  {
                     "type": "array",
-                    "minItems": 2,
-                    "maxItems": 2,
+                    "description": "Additional environment variables to set when launching the program. E.g. `[\"FOO=1\", \"BAR\"]`",
                     "items": {
-                      "type": "string"
-                    }
+                      "type": "string",
+                      "pattern": "^((\\w+=.*)|^\\w+)$"
+                    },
+                    "default": []
+                  }
+                ]
+              },
+              "stopOnEntry": {
+                "type": "boolean",
+                "description": "Automatically stop after launch.",
+                "default": false
+              },
+              "disableASLR": {
+                "type": "boolean",
+                "description": "Enable or disable Address space layout randomization if the debugger supports it.",
+                "default": true
+              },
+              "disableSTDIO": {
+                "type": "boolean",
+                "description": "Don't retrieve STDIN, STDOUT and STDERR as the program is running.",
+                "default": false
+              },
+              "shellExpandArguments": {
+                "type": "boolean",
+                "description": "Expand program arguments as a shell would without actually launching the program in a shell.",
+                "default": false
+              },
+              "detachOnError": {
+                "type": "boolean",
+                "description": "Detach from the program.",
+                "default": false
+              },
+              "sourcePath": {
+                "type": "string",
+                "description": "Specify a source path to remap \"./\" to allow full paths to be used when setting breakpoints in binaries that have relative source paths."
+              },
+              "sourceMap": {
+                "anyOf": [
+                  {
+                    "type": "object",
+                    "description": "Specify an object of path remappings; each entry has a key containing the source path and a value containing the destination path. E.g `{ \"/the/source/path\": \"/the/destination/path\" }`. Overrides sourcePath.",
+                    "patternProperties": {
+                      ".*": {
+                        "type": "string"
+                      }
+                    },
+                    "default": {}
                   },
-                  "default": []
-                }
-              ]
-            },
-            "debuggerRoot": {
-              "type": "string",
-              "description": "Specify a working directory to set the debug adapter to so relative object files can be located."
-            },
-            "targetTriple": {
-              "type": "string",
-              "description": "Triplet of the target architecture to override value derived from the program file."
-            },
-            "platformName": {
-              "type": "string",
-              "description": "Name of the execution platform to override value derived from the program file."
-            },
-            "initCommands": {
-              "type": "array",
-              "items": {
-                "type": "string"
+                  {
+                    "type": "array",
+                    "description": "Specify an array of path remappings; each element must itself be a two element array containing a source and destination path name. Overrides sourcePath.",
+                    "items": {
+                      "type": "array",
+                      "minItems": 2,
+                      "maxItems": 2,
+                      "items": {
+                        "type": "string"
+                      }
+                    },
+                    "default": []
+                  }
+                ]
               },
-              "description": "Initialization commands executed upon debugger startup.",
-              "default": []
-            },
-            "preRunCommands": {
-              "type": "array",
-              "items": {
-                "type": "string"
+              "debuggerRoot": {
+                "type": "string",
+                "description": "Specify a working directory to set the debug adapter to so relative object files can be located."
               },
-              "description": "Commands executed just before the program is launched.",
-              "default": []
-            },
-            "postRunCommands": {
-              "type": "array",
-              "items": {
-                "type": "string"
+              "targetTriple": {
+                "type": "string",
+                "description": "Triplet of the target architecture to override value derived from the program file."
               },
-              "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"
+              "platformName": {
+                "type": "string",
+                "description": "Name of the execution platform to override value derived from the program file."
               },
-              "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"
+              "initCommands": {
+                "type": "array",
+                "items": {
+                  "type": "string"
+                },
+                "description": "Initialization commands executed upon debugger startup.",
+                "default": []
               },
-              "description": "Commands executed each time the program stops.",
-              "default": []
-            },
-            "exitCommands": {
-              "type": "array",
-              "items": {
-                "type": "string"
+              "preRunCommands": {
+                "type": "array",
+                "items": {
+                  "type": "string"
+                },
+                "description": "Commands executed just before the program is launched.",
+                "default": []
               },
-              "description": "Commands executed when the program exits.",
-              "default": []
-            },
-            "terminateCommands": {
-              "type": "array",
-              "items": {
-                "type": "string"
+              "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": []
               },
-              "description": "Commands executed when the debugging session ends.",
-              "default": []
-            },
-            "runInTerminal": {
-              "type": "boolean",
-              "description": "Launch the program inside an integrated terminal in the IDE. Useful for debugging interactive command line programs",
-              "default": false
-            },
-            "timeout": {
-              "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": {
-              "type": "boolean",
-              "description": "Enable auto generated summaries for variables when no summaries exist for a given type. This feature can cause performance delays in large projects when viewing variables.",
-              "default": false
-            },
-            "displayExtendedBacktrace": {
-              "type": "boolean",
-              "description": "Enable language specific extended backtraces.",
-              "default": false
-            },
-            "enableSyntheticChildDebugging": {
-              "type": "boolean",
-              "description": "If a variable is displayed using a synthetic children, also display the actual contents of the variable at the end under a [raw] entry. This is useful when creating sythetic child plug-ins as it lets you see the actual contents of the variable.",
-              "default": false
-            },
-            "commandEscapePrefix": {
-              "type": "string",
-              "description": "The escape prefix to use for executing regular LLDB commands in the Debug Console, instead of printing variables. Defaults to a back-tick (`). If it's an empty string, then all expression in the Debug Console are treated as regular LLDB commands.",
-              "default": "`"
-            },
-            "customFrameFormat": {
-              "type": "string",
-              "description": "If non-empty, stack frames will have descriptions generated based on the provided format. See https://lldb.llvm.org/use/formatting.html for an explanation on format strings for frames. If the format string contains errors, an error message will be displayed on the Debug Console and the default frame names will be used. This might come with a performance cost because debug information might need to be processed to generate the description.",
-              "default": ""
-            },
-            "customThreadFormat": {
-              "type": "string",
-              "description": "If non-empty, threads will have descriptions generated based on the provided format. See https://lldb.llvm.org/use/formatting.html for an explanation on format strings for threads. If the format string contains errors, an error message will be displayed on the Debug Console and the default thread names will be used. This might come with a performance cost because debug information might need to be processed to generate the description.",
-              "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"
+                },
+                "d...
[truncated]

@Jlalond
Copy link
Contributor

Jlalond commented May 7, 2025

@ashgti Hey John, do you mind splitting this patch?

Because one part of it is fixing the bad merge, and one part is formatting. Putting them together makes the meat of this patch harder to follow.

As for the package.json, do we have any tests that try to npm build? Should we add them?

The package.json is currently malformed after a bad merge in 39e6e88.
@ashgti ashgti force-pushed the lldb-dap-package branch from 08eb355 to 05b7090 Compare May 7, 2025 17:47
@ashgti ashgti changed the title [lldb-dap] Fix the package.json and format lldb-dap typescript. [lldb-dap] Fix package.json after a bad merge. May 7, 2025
@ashgti
Copy link
Contributor Author

ashgti commented May 7, 2025

@ashgti Hey John, do you mind splitting this patch?

Sure, I'll make this fixing the package.json.

As for the package.json, do we have any tests that try to npm build? Should we add them?

I don't think they're run as part of the CI today. We could see if there is some way to integrate the npm build / tests into the lldb-dap CI somehow.

@ashgti ashgti requested a review from Jlalond May 7, 2025 17:51
Copy link
Contributor

@Jlalond Jlalond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ashgti!

@ashgti ashgti merged commit bf59716 into llvm:main May 7, 2025
6 of 9 checks passed
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