[Lldb-commits] [lldb] [lldb] Add QSupported key to report watchpoint types supported (PR #80376)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 2 06:02:12 PST 2024


================
@@ -38,7 +38,44 @@ read packet: +
 read packet: $OK#9a
 send packet: +
 
+//----------------------------------------------------------------------
+// "QSupported"
+//
+// BRIEF
+//  Query the GDB remote server for features it supports
+//
+// PRIORITY TO IMPLEMENT
+//  Optional.
+//----------------------------------------------------------------------
 
+QSupported is a standard GDB Remote Serial Protocol packet, but
+there are several additions to the response that lldb can parse.
+An example exchange:
+
+send packet: qSupported:xmlRegisters=i386,arm,mips,arc;multiprocess+;fork-events+;vfork-events+
+
+read packet: qXfer:features:read+;PacketSize=20000;qEcho+;native-signals+;SupportedCompressions=lzfse,zlib-deflate,lz4,lzma;SupportedWatchpointTypes =aarch64-mask,aarch64-bas;
+
+In this example, three lldb extensions are reported:
+  PacketSize=20000
+    The base16 maximum packet size that the GDB Remote Serial stub
+    can handle.
+  SupportedCompressions=<item,item,...>
+    A list of compression types that the GDB Remote Serial stub can use to
+    compress packets when the QEnableCompression packet is used to request one
+    of them.
+  SupportedWatchpointTypes=<item,item,...>
+    A list of watchpoint types that this GDB Remote Serial stub can manage.
+    Currently defined names are:
+        x86_64       64-bit x86-64 watchpoints
+                     (1, 2, 4, 8 byte watchpoints aligned to those amounts)
+        aarch64-bas  AArch64 Byte Address Select watchpoints
+                     (any number of contiguous bytes within a doubleword)
+        aarch64-mask AArch64 MASK watchpoints
+                     (any power-of-2 region of memory from 8 to 2GB, aligned)
+
+lldb will default to sending power-of-2 watchpoints up to a pointer size,
+`sizeof(void*)`, in the target process if nothing is specified.
----------------
DavidSpickett wrote:

I would rephrase and put "If nothing is specified" first, so the reader knows immediately what the point of this is.

Also tab it in to be part of the `SupportedWatchpointTypes` block.

https://github.com/llvm/llvm-project/pull/80376


More information about the lldb-commits mailing list