diff options
Diffstat (limited to 'llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp')
-rw-r--r-- | llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp index 49f5fcd..b11d875 100644 --- a/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp +++ b/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp @@ -27,22 +27,6 @@ using namespace llvm; using namespace llvm::orc; -Error addDebugSupport(ObjectLayer &ObjLayer) { - ExecutionSession &ES = ObjLayer.getExecutionSession(); - auto Registrar = createJITLoaderGDBRegistrar(ES); - if (!Registrar) - return Registrar.takeError(); - - auto *ObjLinkingLayer = cast<ObjectLinkingLayer>(&ObjLayer); - if (!ObjLinkingLayer) - return createStringError(inconvertibleErrorCode(), - "No debug support for given object layer type"); - - ObjLinkingLayer->addPlugin(std::make_unique<DebugObjectManagerPlugin>( - ES, std::move(*Registrar), true, true)); - return Error::success(); -} - Expected<std::unique_ptr<DefinitionGenerator>> loadDylib(ExecutionSession &ES, StringRef RemotePath) { if (auto Handle = ES.getExecutorProcessControl().loadDylib(RemotePath.data())) @@ -111,11 +95,15 @@ launchLocalExecutor(StringRef ExecutablePath) { close(FromExecutor[ReadEnd]); // Execute the child process. - std::unique_ptr<char[]> ExecPath, FDSpecifier; + std::unique_ptr<char[]> ExecPath, FDSpecifier, TestOutputFlag; { ExecPath = std::make_unique<char[]>(ExecutablePath.size() + 1); strcpy(ExecPath.get(), ExecutablePath.data()); + const char *TestOutputFlagStr = "test-jitloadergdb"; + TestOutputFlag = std::make_unique<char[]>(strlen(TestOutputFlagStr) + 1); + strcpy(TestOutputFlag.get(), TestOutputFlagStr); + std::string FDSpecifierStr("filedescs="); FDSpecifierStr += utostr(ToExecutor[ReadEnd]); FDSpecifierStr += ','; @@ -124,7 +112,8 @@ launchLocalExecutor(StringRef ExecutablePath) { strcpy(FDSpecifier.get(), FDSpecifierStr.c_str()); } - char *const Args[] = {ExecPath.get(), FDSpecifier.get(), nullptr}; + char *const Args[] = {ExecPath.get(), TestOutputFlag.get(), + FDSpecifier.get(), nullptr}; int RC = execvp(ExecPath.get(), Args); if (RC != 0) return make_error<StringError>( |