LLVM API Documentation
#include <MemoryObject.h>

Public Member Functions | |
| virtual | ~MemoryObject () |
| Destructor - Override as necessary. | |
| virtual uint64_t | getBase () const =0 |
| virtual uint64_t | getExtent () const =0 |
| virtual int | readByte (uint64_t address, uint8_t *ptr) const =0 |
| virtual int | readBytes (uint64_t address, uint64_t size, uint8_t *buf) const |
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. All size and offset parameters are uint64_ts, to allow 32-bit processes access to 64-bit address spaces.
Definition at line 22 of file MemoryObject.h.
| MemoryObject::~MemoryObject | ( | ) | [virtual] |
Destructor - Override as necessary.
Definition at line 13 of file MemoryObject.cpp.
| virtual uint64_t llvm::MemoryObject::getBase | ( | ) | const [pure virtual] |
getBase - Returns the lowest valid address in the region.
Implemented in llvm::StreamingMemoryObject, llvm::StreamableMemoryObject, and llvm::StringRefMemoryObject.
Referenced by readBytes().
| virtual uint64_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).
Implemented in llvm::StreamingMemoryObject, llvm::StreamableMemoryObject, and llvm::StringRefMemoryObject.
Referenced by readBytes().
| virtual int llvm::MemoryObject::readByte | ( | uint64_t | address, |
| uint8_t * | ptr | ||
| ) | const [pure virtual] |
readByte - Tries to read a single byte from the region.
| 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. |
Implemented in llvm::StreamingMemoryObject, llvm::StreamableMemoryObject, and llvm::StringRefMemoryObject.
Referenced by readBytes(), and regionReader().
| int MemoryObject::readBytes | ( | uint64_t | address, |
| uint64_t | size, | ||
| uint8_t * | buf | ||
| ) | const [virtual] |
readBytes - 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.
| address | - The address of the first byte, in the same space as getBase(). |
| size | - The 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. |
Reimplemented in llvm::StreamingMemoryObject, llvm::StreamableMemoryObject, and llvm::StringRefMemoryObject.
Definition at line 16 of file MemoryObject.cpp.
References getBase(), getExtent(), and readByte().
Referenced by llvm::AArch64Disassembler::getInstruction(), readInstruction16(), and readInstruction32().