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

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 28 09:04:38 PDT 2026


https://github.com/da-viper updated https://github.com/llvm/llvm-project/pull/236446

>From c6e86bddeba12ade745d3ebffb08a46c6bcbd090 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <e_ezike at apple.com>
Date: Wed, 28 Oct 2026 14:47:29 +0000
Subject: [PATCH 1/2] [lldb-dap] Clarify the naming rules for protocol
 extensions

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.
---
 lldb/docs/resources/lldbdap-contributing.md |  7 +++----
 lldb/docs/resources/lldbdap-extensions.md   | 18 +++++++++++-------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/lldb/docs/resources/lldbdap-contributing.md b/lldb/docs/resources/lldbdap-contributing.md
index 2fa72ce2fe4aa8..b49346dce1e0e3 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).
 
 ### Debugging the Debug Adapter Protocol
 
diff --git a/lldb/docs/resources/lldbdap-extensions.md b/lldb/docs/resources/lldbdap-extensions.md
index 2475aab768318a..6ed69c234ee1c2 100644
--- a/lldb/docs/resources/lldbdap-extensions.md
+++ b/lldb/docs/resources/lldbdap-extensions.md
@@ -4,13 +4,17 @@ 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 has no 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
 

>From 6c3a0f2fcf701147ae5e9be418c894dabfe00a69 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Wed, 28 Oct 2026 16:04:10 +0000
Subject: [PATCH 2/2] format and add review changes

---
 lldb/docs/resources/lldbdap-contributing.md |  2 +-
 lldb/docs/resources/lldbdap-extensions.md   | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lldb/docs/resources/lldbdap-contributing.md b/lldb/docs/resources/lldbdap-contributing.md
index b49346dce1e0e3..022450662e30f8 100644
--- a/lldb/docs/resources/lldbdap-contributing.md
+++ b/lldb/docs/resources/lldbdap-contributing.md
@@ -72,7 +72,7 @@ inspiration from it. If not, consider opening an upstream issue.
 
 To avoid naming collisions with future versions of the Debug Adapter
 Protocol, follow the naming rules in
-[LLDB-DAP Extensions](./lldbdap-extensions.md).
+[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 6ed69c234ee1c2..9083dcc119df34 100644
--- a/lldb/docs/resources/lldbdap-extensions.md
+++ b/lldb/docs/resources/lldbdap-extensions.md
@@ -12,7 +12,7 @@ lldb-dap implements the
 - 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 has no prefix. Extension types are the
+- 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`).
 
@@ -21,10 +21,10 @@ lldb-dap implements the
 :::{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  |
 
 :::
 
@@ -41,7 +41,7 @@ and the `id` of a [`Module`](#module).
 
 ```typescript
 interface CompileUnitsRequest extends Request {
-  command: 'compileUnits';
+  command: "compileUnits";
 
   arguments: CompileUnitsArguments;
 }
@@ -93,7 +93,7 @@ is true.
 
 ```typescript
 interface ModuleSymbolsRequest extends Request {
-  command: '__lldb_moduleSymbols';
+  command: "__lldb_moduleSymbols";
 
   arguments: ModuleSymbolsArguments;
 }
@@ -126,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