llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

<details>
<summary>Changes</summary>

This creates a very basic module explorer for tracking and displaying loaded 
modules, reported by lldb-dap for the active debug session.

This includes a basic session tracker that we can use to observe the debug 
session and collect specific information for additional visualizations in the 
lldb-dap ext.

Here is a screenshot of the current visualization in the tree view. There is 
some unfortunate wrapping of the path, but it shows the basic support that 
could be extended in the future.

&lt;img width="1759" alt="Screenshot 2025-05-07 at 2 52 50 PM" 
src="https://github.com/user-attachments/assets/588baa2f-61d5-4434-8692-b1d0cce42875";
 /&gt;


---

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


7 Files Affected:

- (modified) lldb/tools/lldb-dap/package-lock.json (+10-2) 
- (modified) lldb/tools/lldb-dap/package.json (+498-487) 
- (modified) lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts (+3-2) 
- (added) lldb/tools/lldb-dap/src-ts/debug-session-tracker.ts (+87) 
- (modified) lldb/tools/lldb-dap/src-ts/disposable-context.ts (+2-2) 
- (modified) lldb/tools/lldb-dap/src-ts/extension.ts (+18) 
- (added) lldb/tools/lldb-dap/src-ts/ui/modules-data-provider.ts (+58) 


``````````diff
diff --git a/lldb/tools/lldb-dap/package-lock.json 
b/lldb/tools/lldb-dap/package-lock.json
index ab5c7dc33a8e5..0a2b9e764067e 100644
--- a/lldb/tools/lldb-dap/package-lock.json
+++ b/lldb/tools/lldb-dap/package-lock.json
@@ -1,16 +1,17 @@
 {
   "name": "lldb-dap",
-  "version": "0.2.10",
+  "version": "0.2.13",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "lldb-dap",
-      "version": "0.2.10",
+      "version": "0.2.13",
       "license": "Apache 2.0 License with LLVM exceptions",
       "devDependencies": {
         "@types/node": "^18.19.41",
         "@types/vscode": "1.75.0",
+        "@vscode/debugprotocol": "^1.68.0",
         "@vscode/vsce": "^3.2.2",
         "prettier": "^3.4.2",
         "prettier-plugin-curly": "^0.3.1",
@@ -405,6 +406,13 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/@vscode/debugprotocol": {
+      "version": "1.68.0",
+      "resolved": 
"https://registry.npmjs.org/@vscode/debugprotocol/-/debugprotocol-1.68.0.tgz";,
+      "integrity": 
"sha512-2J27dysaXmvnfuhFGhfeuxfHRXunqNPxtBoR3koiTOA9rdxWNDTa1zIFLCFMSHJ9MPTPKFcBeblsyaCJCIlQxg==",
+      "dev": true,
+      "license": "MIT"
+    },
     "node_modules/@vscode/vsce": {
       "version": "3.2.2",
       "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-3.2.2.tgz";,
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index 4734c9d7277bb..ae4973a1c6985 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -30,9 +30,10 @@
   "devDependencies": {
     "@types/node": "^18.19.41",
     "@types/vscode": "1.75.0",
+    "@vscode/debugprotocol": "^1.68.0",
     "@vscode/vsce": "^3.2.2",
-    "prettier-plugin-curly": "^0.3.1",
     "prettier": "^3.4.2",
+    "prettier-plugin-curly": "^0.3.1",
     "typescript": "^5.7.3"
   },
   "activationEvents": [
@@ -242,527 +243,537 @@
           }
         }
       }
-    ]
-  },
-  "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": ""
-            },
-            "cust...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/138977
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to