[Orc] Add support for EH-frame registration to the Orc Remote Target utility
classes.
OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the
server automatically. This allows remote-execution of code that uses exceptions.
llvm-svn: 257816
diff --git a/llvm/tools/lli/ChildTarget/ChildTarget.cpp b/llvm/tools/lli/ChildTarget/ChildTarget.cpp
index 0b75e20..93925d6 100644
--- a/llvm/tools/lli/ChildTarget/ChildTarget.cpp
+++ b/llvm/tools/lli/ChildTarget/ChildTarget.cpp
@@ -41,9 +41,17 @@
return RTDyldMemoryManager::getSymbolAddressInProcess(Name);
};
+ auto RegisterEHFrames = [](uint8_t *Addr, uint32_t Size) {
+ RTDyldMemoryManager::registerEHFramesInProcess(Addr, Size);
+ };
+
+ auto DeregisterEHFrames = [](uint8_t *Addr, uint32_t Size) {
+ RTDyldMemoryManager::deregisterEHFramesInProcess(Addr, Size);
+ };
+
FDRPCChannel Channel(InFD, OutFD);
typedef remote::OrcRemoteTargetServer<FDRPCChannel, HostOrcArch> JITServer;
- JITServer Server(Channel, SymbolLookup);
+ JITServer Server(Channel, SymbolLookup, RegisterEHFrames, DeregisterEHFrames);
while (1) {
JITServer::JITProcId Id = JITServer::InvalidId;