virtual uint64_t getExtent() const = 0;
/// Tries to read a contiguous range of bytes from the region, up to the end
- /// of the region. You should override this function if there is a quicker way
- /// than going back and forth with individual bytes.
+ /// of the region.
///
/// @param address - The address of the first byte, in the same space as
/// getBase().
/// @param size - The number of bytes to copy.
/// @param buf - A pointer to a buffer to be filled in. Must be non-NULL
/// and large enough to hold size bytes.
- /// @result - 0 if successful; -1 if not. Failure may be due to a
- /// bounds violation or an implementation-specific error.
- virtual int readBytes(uint64_t address, uint64_t size,
- uint8_t *buf) const = 0;
+ /// @result - The number of bytes read.
+ virtual uint64_t readBytes(uint8_t *Buf, uint64_t Size,
+ uint64_t Address) const = 0;
/// Ensures that the requested data is in memory, and returns a pointer to it.
/// More efficient than using readBytes if the data is already in memory. May