1 //===-- InProcessMemoryAccess.h - Direct, in-process mem access -*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Accesses memory in the current process. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_EXECUTIONENGINE_ORC_INPROCESSMEMORYACCESS_H 14 #define LLVM_EXECUTIONENGINE_ORC_INPROCESSMEMORYACCESS_H 15 16 #include "llvm/ExecutionEngine/Orc/MemoryAccess.h" 17 18 namespace llvm::orc { 19 20 class LLVM_ABI InProcessMemoryAccess : public MemoryAccess { 21 public: InProcessMemoryAccess(bool IsArch64Bit)22 InProcessMemoryAccess(bool IsArch64Bit) : IsArch64Bit(IsArch64Bit) {} 23 void writeUInt8sAsync(ArrayRef<tpctypes::UInt8Write> Ws, 24 WriteResultFn OnWriteComplete) override; 25 26 void writeUInt16sAsync(ArrayRef<tpctypes::UInt16Write> Ws, 27 WriteResultFn OnWriteComplete) override; 28 29 void writeUInt32sAsync(ArrayRef<tpctypes::UInt32Write> Ws, 30 WriteResultFn OnWriteComplete) override; 31 32 void writeUInt64sAsync(ArrayRef<tpctypes::UInt64Write> Ws, 33 WriteResultFn OnWriteComplete) override; 34 35 void writePointersAsync(ArrayRef<tpctypes::PointerWrite> Ws, 36 WriteResultFn OnWriteComplete) override; 37 38 void writeBuffersAsync(ArrayRef<tpctypes::BufferWrite> Ws, 39 WriteResultFn OnWriteComplete) override; 40 41 void readUInt8sAsync(ArrayRef<ExecutorAddr> Rs, 42 OnReadUIntsCompleteFn<uint8_t> OnComplete) override; 43 44 void readUInt16sAsync(ArrayRef<ExecutorAddr> Rs, 45 OnReadUIntsCompleteFn<uint16_t> OnComplete) override; 46 47 void readUInt32sAsync(ArrayRef<ExecutorAddr> Rs, 48 OnReadUIntsCompleteFn<uint32_t> OnComplete) override; 49 50 void readUInt64sAsync(ArrayRef<ExecutorAddr> Rs, 51 OnReadUIntsCompleteFn<uint64_t> OnComplete) override; 52 53 void readPointersAsync(ArrayRef<ExecutorAddr> Rs, 54 OnReadPointersCompleteFn OnComplete) override; 55 56 void readBuffersAsync(ArrayRef<ExecutorAddrRange> Rs, 57 OnReadBuffersCompleteFn OnComplete) override; 58 59 void readStringsAsync(ArrayRef<ExecutorAddr> Rs, 60 OnReadStringsCompleteFn OnComplete) override; 61 62 private: 63 bool IsArch64Bit; 64 }; 65 66 } // namespace llvm::orc 67 68 #endif // LLVM_EXECUTIONENGINE_ORC_INPROCESSMEMORYACCESS_H 69