- enum ReadMode {
- Normal,
- /** Allows the `read_bytes` to return a pointer to another buffer
- * where the data ins available instead of copying the data into the buffer
- */
- Lazy
- };
- virtual ~AddressSpace();
- virtual const void* read_bytes(void* buffer, std::size_t size,
- remote_ptr<void> address, int process_index = ProcessIndexAny,
- ReadMode mode = Normal) const = 0;
-
- template<class T> inline
- void read(T *buffer, remote_ptr<T> ptr, int process_index = ProcessIndexAny)
+ explicit AddressSpace(RemoteClient* process) : process_(process) {}
+ virtual ~AddressSpace() = default;
+
+ /** The process of this address space
+ *
+ * This is where we can get debug informations, memory layout, etc.
+ */
+ simgrid::mc::RemoteClient* process() const { return process_; }
+
+ /** Read data from the address space
+ *
+ * @param buffer target buffer for the data
+ * @param size number of bytes to read
+ * @param address remote source address of the data
+ * @param options
+ */
+ virtual const void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+ ReadOptions options = ReadOptions::none()) const = 0;
+
+ /** Read a given data structure from the address space */
+ template <class T> inline void read(T* buffer, RemotePtr<T> ptr) const { this->read_bytes(buffer, sizeof(T), ptr); }
+
+ template <class T> inline void read(Remote<T>& buffer, RemotePtr<T> ptr) const