[Lldb-commits] [lldb] [lldb] Propose MultiBreakpoint extension to GDB Remote (PR #192910)
Felipe de Azevedo Piovezan via lldb-commits
lldb-commits at lists.llvm.org
Sat Apr 25 01:41:02 PDT 2026
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/192910
>From 030299bebcd76e5f09bb3be5e396bcd691d1ad23 Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Fri, 20 Mar 2026 12:59:11 +0000
Subject: [PATCH 1/2] [lldb] Propose MultiBreakpoint extension to GDB Remote
See discussion in: https://discourse.llvm.org/t/rfc-a-new-packet-to-set-remove-multiple-breakpoints/
---
lldb/docs/resources/lldbgdbremote.md | 44 ++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/lldb/docs/resources/lldbgdbremote.md b/lldb/docs/resources/lldbgdbremote.md
index 9aa7ad2259a6a..e4cdf044dc160 100644
--- a/lldb/docs/resources/lldbgdbremote.md
+++ b/lldb/docs/resources/lldbgdbremote.md
@@ -618,6 +618,50 @@ running, then an error message is returned.
do live tracing. Specifically, the name of the plug-in should match the name
of the tracing technology returned by this packet.
+## jMultiBreakpoint
+
+This packet allows setting and removing multiple breakpoints in one go. It
+lists multiple `Z` and `z` packets using a JSON array of strings.
+Formally:
+
+```
+$jMultiBreakpoint:{"breakpoint_requests" : ["request"[,"request"]*]}
+```
+
+Where each `request` is one of:
+
+```
+* z0,addr,kind
+* z1,addr,kind
+* z2,addr,kind
+* z3,addr,kind
+* z4,addr,kind
+* Z0,addr,kind[;cond_list…][;cmds:persist,cmd_list…]
+* Z1,addr,kind[;cond_list…][;cmds:persist,cmd_list…]
+* Z2,addr,kind
+* Z3,addr,kind
+* Z4,addr,kind
+```
+
+Each field has the same meaning as the corresponding packet in the GDB Remote
+Protocol.
+
+The stub must execute the sequence of `request`s in the order they
+appear in the `jMultiBreakpoint` packet. This is not an atomic operation:
+individual requests may fail, and the stub must process subsequent requests
+upon failure.
+
+The reply consists of a JSON dictionary with a single entry, `results`, which
+is an array of strings, with the same contents allowed by a reply to a `z` or
+`Z` packet.
+
+```
+{"results": ["E03", "OK", "OK"]}
+```
+
+A stub that supports this packet must include `jMultiBreakpoint+` in the reply
+to `qSupported`.
+
## jThreadExtendedInfo
This packet, which takes its arguments as JSON and sends its reply as
>From 6639bfaae4da2a16b13ba0b5ed3ea3c239d7d5ae Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Sat, 25 Apr 2026 09:40:43 +0100
Subject: [PATCH 2/2] fixup! address review feedback
---
lldb/docs/resources/lldbgdbremote.md | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/lldb/docs/resources/lldbgdbremote.md b/lldb/docs/resources/lldbgdbremote.md
index e4cdf044dc160..a475633c1883a 100644
--- a/lldb/docs/resources/lldbgdbremote.md
+++ b/lldb/docs/resources/lldbgdbremote.md
@@ -646,22 +646,34 @@ Where each `request` is one of:
Each field has the same meaning as the corresponding packet in the GDB Remote
Protocol.
+For example, the packet below is a request to set one breakpoint and to remove
+two others:
+
+```
+$jMultiBreakpoint: {"breakpoint_requests": ["Z0,1025783e8,4", "z0,1025783ec,4", "z0,1025783e8,4"]}
+```
+
+The same address may be specified multiple times.
+
The stub must execute the sequence of `request`s in the order they
appear in the `jMultiBreakpoint` packet. This is not an atomic operation:
individual requests may fail, and the stub must process subsequent requests
-upon failure.
+regardless of previous failures.
The reply consists of a JSON dictionary with a single entry, `results`, which
is an array of strings, with the same contents allowed by a reply to a `z` or
`Z` packet.
```
-{"results": ["E03", "OK", "OK"]}
+{"results": ["OK", "E03", "OK"]}
```
A stub that supports this packet must include `jMultiBreakpoint+` in the reply
to `qSupported`.
+**Priority To Implement:** Low. This is a performance optimization, reducing
+the number of packets sent when manipulating breakpoints.
+
## jThreadExtendedInfo
This packet, which takes its arguments as JSON and sends its reply as
More information about the lldb-commits
mailing list