|  | 
| 21 | 21 | #define LLDB_TOOLS_LLDB_DAP_PROTOCOL_PROTOCOL_EVENTS_H | 
| 22 | 22 | 
 | 
| 23 | 23 | #include "Protocol/ProtocolTypes.h" | 
|  | 24 | +#include "lldb/lldb-defines.h" | 
| 24 | 25 | #include "lldb/lldb-types.h" | 
| 25 | 26 | #include "llvm/Support/JSON.h" | 
| 26 | 27 | #include <cstdint> | 
| @@ -88,6 +89,34 @@ struct InvalidatedEventBody { | 
| 88 | 89 | llvm::json::Value toJSON(const InvalidatedEventBody::Area &); | 
| 89 | 90 | llvm::json::Value toJSON(const InvalidatedEventBody &); | 
| 90 | 91 | 
 | 
|  | 92 | +/// This event indicates that some memory range has been updated. It should only | 
|  | 93 | +/// be sent if the corresponding capability supportsMemoryEvent is true. | 
|  | 94 | +/// | 
|  | 95 | +/// Clients typically react to the event by re-issuing a readMemory request if | 
|  | 96 | +/// they show the memory identified by the memoryReference and if the updated | 
|  | 97 | +/// memory range overlaps the displayed range. Clients should not make | 
|  | 98 | +/// assumptions how individual memory references relate to each other, so they | 
|  | 99 | +/// should not assume that they are part of a single continuous address range | 
|  | 100 | +/// and might overlap. | 
|  | 101 | +/// | 
|  | 102 | +/// Debug adapters can use this event to indicate that the contents of a memory | 
|  | 103 | +/// range has changed due to some other request like setVariable or | 
|  | 104 | +/// setExpression. Debug adapters are not expected to emit this event for each | 
|  | 105 | +/// and every memory change of a running program, because that information is | 
|  | 106 | +/// typically not available from debuggers and it would flood clients with too | 
|  | 107 | +/// many events. | 
|  | 108 | +struct MemoryEventBody { | 
|  | 109 | +  /// Memory reference of a memory range that has been updated. | 
|  | 110 | +  lldb::addr_t memoryReference = LLDB_INVALID_ADDRESS; | 
|  | 111 | + | 
|  | 112 | +  /// Starting offset in bytes where memory has been updated. Can be negative. | 
|  | 113 | +  int64_t offset = 0; | 
|  | 114 | + | 
|  | 115 | +  /// Number of bytes updated. | 
|  | 116 | +  uint64_t count = 0; | 
|  | 117 | +}; | 
|  | 118 | +llvm::json::Value toJSON(const MemoryEventBody &); | 
|  | 119 | + | 
| 91 | 120 | } // end namespace lldb_dap::protocol | 
| 92 | 121 | 
 | 
| 93 | 122 | #endif | 
0 commit comments