[Lldb-commits] [lldb] [lldb-dap] Add memory event (PR #158437)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 15 10:38:05 PDT 2025


================
@@ -88,6 +88,34 @@ struct InvalidatedEventBody {
 llvm::json::Value toJSON(const InvalidatedEventBody::Area &);
 llvm::json::Value toJSON(const InvalidatedEventBody &);
 
+/// This event indicates that some memory range has been updated. It should only
+/// be sent if the corresponding capability supportsMemoryEvent is true.
+///
+/// Clients typically react to the event by re-issuing a readMemory request if
+/// they show the memory identified by the memoryReference and if the updated
+/// memory range overlaps the displayed range. Clients should not make
+/// assumptions how individual memory references relate to each other, so they
+/// should not assume that they are part of a single continuous address range
+/// and might overlap.
+///
+/// Debug adapters can use this event to indicate that the contents of a memory
+/// range has changed due to some other request like setVariable or
+/// setExpression. Debug adapters are not expected to emit this event for each
+/// and every memory change of a running program, because that information is
+/// typically not available from debuggers and it would flood clients with too
+/// many events.
+struct MemoryEventBody {
+  /// Memory reference of a memory range that has been updated.
+  lldb::addr_t memoryReference;
+
+  /// Starting offset in bytes where memory has been updated. Can be negative.
+  int64_t offset;
+
+  /// Number of bytes updated.
+  uint64_t count;
----------------
ashgti wrote:

Can we have a default of 0 or a some define/const value for these?

In case we don't need to set a value.

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


More information about the lldb-commits mailing list