LLVM API Documentation

llvm::MemoryObject Class Reference

#include <MemoryObject.h>

List of all members.

Public Member Functions

virtual ~MemoryObject ()
 Destructor - Override as necessary.
virtual uintptr_t getBase () const =0
virtual uintptr_t getExtent () const =0
virtual int readByte (uintptr_t address, uint8_t *ptr) const =0
virtual uintptr_t readBytes (uintptr_t address, uintptr_t size, uint8_t *buf) const


Detailed Description

MemoryObject - Abstract base class for contiguous addressable memory. Necessary for cases in which the memory is in another process, in a file, or on a remote machine.

Definition at line 20 of file MemoryObject.h.


Constructor & Destructor Documentation

virtual llvm::MemoryObject::~MemoryObject (  )  [inline, virtual]

Destructor - Override as necessary.

Definition at line 23 of file MemoryObject.h.


Member Function Documentation

virtual uintptr_t llvm::MemoryObject::getBase (  )  const [pure virtual]

getBase - Returns the lowest valid address in the region.

Returns:
- The lowest valid address.

Referenced by readBytes().

virtual uintptr_t llvm::MemoryObject::getExtent (  )  const [pure virtual]

getExtent - Returns the size of the region in bytes. (The region is contiguous, so the highest valid address of the region is getBase() + getExtent() - 1).

Returns:
- The size of the region.

Referenced by readBytes().

virtual int llvm::MemoryObject::readByte ( uintptr_t  address,
uint8_t *  ptr 
) const [pure virtual]

readByte - Tries to read a single byte from the region.

Parameters:
address - The address of the byte, in the same space as getBase().
ptr - A pointer to a byte to be filled in. Must be non-NULL.
Returns:
- 0 if successful; -1 if not. Failure may be due to a bounds violation or an implementation-specific error.

Referenced by readBytes().

virtual uintptr_t llvm::MemoryObject::readBytes ( uintptr_t  address,
uintptr_t  size,
uint8_t *  buf 
) const [inline, virtual]

readByte - 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.

Parameters:
address - The address of the first byte, in the same space as getBase().
size - The maximum number of bytes to copy.
buf - A pointer to a buffer to be filled in. Must be non-NULL and large enough to hold size bytes.
Returns:
- The number of bytes copied if successful; (uintptr_t)-1 if not. Failure may be due to a bounds violation or an implementation-specific error.

Definition at line 60 of file MemoryObject.h.

References getBase(), getExtent(), and readByte().


The documentation for this class was generated from the following file: