diff options
Diffstat (limited to 'tools/lli/RemoteTarget.h')
-rw-r--r-- | tools/lli/RemoteTarget.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/lli/RemoteTarget.h b/tools/lli/RemoteTarget.h index a7d4e59e3b..44e649e6e1 100644 --- a/tools/lli/RemoteTarget.h +++ b/tools/lli/RemoteTarget.h @@ -27,7 +27,8 @@ namespace llvm { class RemoteTarget { bool IsRunning; - SmallVector<sys::MemoryBlock, 16> Allocations; + typedef SmallVector<sys::MemoryBlock, 16> AllocMapType; + AllocMapType Allocations; protected: std::string ErrorMsg; @@ -47,6 +48,18 @@ public: unsigned Alignment, uint64_t &Address); + bool isAllocatedMemory(uint64_t Address, uint32_t Size) { + uint64_t AddressEnd = Address + Size; + for (AllocMapType::const_iterator I = Allocations.begin(), + E = Allocations.end(); + I != E; ++I) { + if (Address >= (uint64_t)I->base() && + AddressEnd <= (uint64_t)I->base() + I->size()) + return true; + } + return false; + } + /// Load data into the target address space. /// /// @param Address Destination address in the target process. |