[Lldb-commits] [lldb] 1a2ed0c - [lldb-dap] Clarify the naming rules for protocol extensions (#236446)

via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 28 10:47:03 PDT 2026


Author: Ebuka Ezike
Date: 2026-10-28T17:46:44Z
New Revision: 1a2ed0c7ca84d7971b7bf74e66dbde583242ecb4

URL: https://github.com/llvm/llvm-project/commit/1a2ed0c7ca84d7971b7bf74e66dbde583242ecb4
DIFF: https://github.com/llvm/llvm-project/commit/1a2ed0c7ca84d7971b7bf74e66dbde583242ecb4.diff

LOG: [lldb-dap] Clarify the naming rules for protocol extensions (#236446)

The old rule allows for conflict when lldb-dap's extension gets added to
the official protocol, as the protocol could then add a field with the
same name but a different type and break clients that expect ours.

Added: 
    

Modified: 
    lldb/docs/resources/lldbdap-contributing.md
    lldb/docs/resources/lldbdap-extensions.md

Removed: 
    


################################################################################
diff  --git a/lldb/docs/resources/lldbdap-contributing.md b/lldb/docs/resources/lldbdap-contributing.md
index 2fa72ce2fe4aa8..022450662e30f8 100644
--- a/lldb/docs/resources/lldbdap-contributing.md
+++ b/lldb/docs/resources/lldbdap-contributing.md
@@ -70,10 +70,9 @@ Protocol](https://github.com/microsoft/debug-adapter-protocol/issues) to check
 if there already is a proposal serving your use case. If so, try to take
 inspiration from it. If not, consider opening an upstream issue.
 
-To avoid naming collisions with potential future extensions of the Debug
-Adapter protocol, all non-standard extensions should use the prefix
-`$__lldb_` in their JSON property names. See
-[LLDB-DAP Extensions](./lldbdap-extensions.md) for more details.
+To avoid naming collisions with future versions of the Debug Adapter
+Protocol, follow the naming rules in
+[LLDB-DAP Extensions](./lldbdap-extensions.md#naming-rules).
 
 ### Debugging the Debug Adapter Protocol
 

diff  --git a/lldb/docs/resources/lldbdap-extensions.md b/lldb/docs/resources/lldbdap-extensions.md
index 2475aab768318a..9083dcc119df34 100644
--- a/lldb/docs/resources/lldbdap-extensions.md
+++ b/lldb/docs/resources/lldbdap-extensions.md
@@ -4,23 +4,27 @@ lldb-dap implements the
 [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/specification)
 (DAP). This page specifies what lldb-dap adds to the protocol, such as new requests and additional fields in protocol types.
 
-Conventions:
-
-- New requests should be prefixed with `__lldb_`.
-- Added properties on standard messages are prefixed with `$__lldb_` if the field
-  would not make sense for any other debugger (e.g. `$__lldb_version`);
-  otherwise, they use plain names (e.g. `compileUnitId`).
-
+## Naming rules
+
+- The `command` field of an extension request must have the `__lldb_` prefix
+  (e.g. `__lldb_moduleSymbols`).
+- The `event` field of an extension event must have the `__lldb_` prefix.
+- An extension field on an official
+  [DAP type](https://microsoft.github.io/debug-adapter-protocol/specification#Types)
+  must have the `$__lldb_` prefix (e.g. `$__lldb_version` on `Capabilities`).
+- A field of an extension type **must not have** a prefix. Extension types are the
+  arguments, response body and event body of an extension request or event,
+  and the types they use (e.g. `startIndex` on `ModuleSymbolsArguments`).
 
 ## Summary
 
 :::{table}
 :width: 100%
 
-| Request | Added in |
-| -------------------------- | --- |
-| [compileUnits](#compileunits-request) | LLDB 11 |
-| [moduleSymbols](#modulesymbols-request) | LLDB 22 |
+| Request                                 | Added in |
+| --------------------------------------- | -------- |
+| [compileUnits](#compileunits-request)   | LLDB 11  |
+| [moduleSymbols](#modulesymbols-request) | LLDB 22  |
 
 :::
 
@@ -37,7 +41,7 @@ and the `id` of a [`Module`](#module).
 
 ```typescript
 interface CompileUnitsRequest extends Request {
-  command: 'compileUnits';
+  command: "compileUnits";
 
   arguments: CompileUnitsArguments;
 }
@@ -89,7 +93,7 @@ is true.
 
 ```typescript
 interface ModuleSymbolsRequest extends Request {
-  command: '__lldb_moduleSymbols';
+  command: "__lldb_moduleSymbols";
 
   arguments: ModuleSymbolsArguments;
 }
@@ -122,8 +126,8 @@ interface ModuleSymbolsArguments {
 interface ModuleSymbolsResponse extends Response {
   body: {
     /**
-    * All symbols or range of symbols.
-    */
+     * All symbols or range of symbols.
+     */
     symbols: Symbol[];
   };
 }


        


More information about the lldb-commits mailing list