Expected<shared::WrapperFunctionResult>
runWrapper(JITTargetAddress WrapperFnAddr,
- ArrayRef<uint8_t> ArgBuffer) override {
+ ArrayRef<char> ArgBuffer) override {
DEBUG_WITH_TYPE("orc", {
dbgs() << "Running as wrapper function "
<< formatv("{0:x16}", WrapperFnAddr) << " with "
static const char *getName() { return "void"; }
};
+template <> class SerializationTypeName<char> {
+public:
+ static const char *getName() { return "char"; }
+};
+
template <> class SerializationTypeName<int8_t> {
public:
static const char *getName() { return "int8_t"; }
class RunWrapper
: public shared::RPCFunction<RunWrapper,
shared::WrapperFunctionResult(
- JITTargetAddress, std::vector<uint8_t>)> {
+ JITTargetAddress, std::vector<char>)> {
public:
static const char *getName() { return "RunWrapper"; }
};
ProgramNameOverride);
}
- shared::WrapperFunctionResult
- runWrapper(JITTargetAddress WrapperFnAddr,
- const std::vector<uint8_t> &ArgBuffer) {
+ shared::WrapperFunctionResult runWrapper(JITTargetAddress WrapperFnAddr,
+ const std::vector<char> &ArgBuffer) {
using WrapperFnTy = shared::detail::CWrapperFunctionResult (*)(
const char *Data, uint64_t Size);
auto *WrapperFn = jitTargetAddressToFunction<WrapperFnTy>(WrapperFnAddr);
- return WrapperFn(reinterpret_cast<const char *>(ArgBuffer.data()),
- ArgBuffer.size());
+ return WrapperFn(ArgBuffer.data(), ArgBuffer.size());
}
void closeConnection() { Finished = true; }
/// \endcode{.cpp}
///
virtual Expected<shared::WrapperFunctionResult>
- runWrapper(JITTargetAddress WrapperFnAddr, ArrayRef<uint8_t> ArgBuffer) = 0;
+ runWrapper(JITTargetAddress WrapperFnAddr, ArrayRef<char> ArgBuffer) = 0;
/// Disconnect from the target process.
///
: TPC(TPC), WrapperFnAddr(WrapperFnAddr) {}
Expected<shared::WrapperFunctionResult> operator()(const char *ArgData,
size_t ArgSize) const {
- return TPC.runWrapper(
- WrapperFnAddr,
- ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(ArgData), ArgSize));
+ return TPC.runWrapper(WrapperFnAddr, ArrayRef<char>(ArgData, ArgSize));
}
private:
ArrayRef<std::string> Args) override;
Expected<shared::WrapperFunctionResult>
- runWrapper(JITTargetAddress WrapperFnAddr,
- ArrayRef<uint8_t> ArgBuffer) override;
+ runWrapper(JITTargetAddress WrapperFnAddr, ArrayRef<char> ArgBuffer) override;
Error disconnect() override;
Expected<shared::WrapperFunctionResult>
SelfTargetProcessControl::runWrapper(JITTargetAddress WrapperFnAddr,
- ArrayRef<uint8_t> ArgBuffer) {
+ ArrayRef<char> ArgBuffer) {
using WrapperFnTy = shared::detail::CWrapperFunctionResult (*)(
const char *Data, uint64_t Size);
auto *WrapperFn = jitTargetAddressToFunction<WrapperFnTy>(WrapperFnAddr);
- return WrapperFn(reinterpret_cast<const char *>(ArgBuffer.data()),
- ArgBuffer.size());
+ return WrapperFn(ArgBuffer.data(), ArgBuffer.size());
}
Error SelfTargetProcessControl::disconnect() { return Error::success(); }