Skip to content

Commit 1477b90

Browse files
[Orc][examples] Drop addDebugSupport() in favor of Orc's enableDebuggerSupport()
1 parent 5f134a7 commit 1477b90

File tree

4 files changed

+5
-25
lines changed

4 files changed

+5
-25
lines changed

llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS
33
ExecutionEngine
44
IRReader
55
JITLink
6+
OrcDebugging
67
OrcJIT
78
OrcShared
89
OrcTargetProcess

llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/LLJITWithRemoteDebugging.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
//
7878
//===----------------------------------------------------------------------===//
7979

80+
#include "llvm/ExecutionEngine/Orc/Debugging/DebuggerSupport.h"
8081
#include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
8182
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
8283
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
@@ -176,15 +177,11 @@ int main(int argc, char *argv[]) {
176177

177178
// Create LLJIT and destroy it before disconnecting the target process.
178179
outs() << "Initializing LLJIT for remote executor\n";
179-
auto J = ExitOnErr(LLJITBuilder()
180-
.setExecutorProcessControl(std::move(EPC))
181-
.setObjectLinkingLayerCreator([&](auto &ES, const auto &TT) {
182-
return std::make_unique<ObjectLinkingLayer>(ES);
183-
})
184-
.create());
180+
auto J = ExitOnErr(
181+
LLJITBuilder().setExecutorProcessControl(std::move(EPC)).create());
185182

186183
// Add plugin for debug support.
187-
ExitOnErr(addDebugSupport(J->getObjLinkingLayer()));
184+
ExitOnErr(enableDebuggerSupport(*J));
188185

189186
// Load required shared libraries on the remote target and add a generator
190187
// for each of it, so the compiler can lookup their symbols.

llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@
2727
using namespace llvm;
2828
using namespace llvm::orc;
2929

30-
Error addDebugSupport(ObjectLayer &ObjLayer) {
31-
ExecutionSession &ES = ObjLayer.getExecutionSession();
32-
auto Registrar = createJITLoaderGDBRegistrar(ES);
33-
if (!Registrar)
34-
return Registrar.takeError();
35-
36-
auto *ObjLinkingLayer = cast<ObjectLinkingLayer>(&ObjLayer);
37-
if (!ObjLinkingLayer)
38-
return createStringError(inconvertibleErrorCode(),
39-
"No debug support for given object layer type");
40-
41-
ObjLinkingLayer->addPlugin(std::make_unique<DebugObjectManagerPlugin>(
42-
ES, std::move(*Registrar), true, true));
43-
return Error::success();
44-
}
45-
4630
Expected<std::unique_ptr<DefinitionGenerator>>
4731
loadDylib(ExecutionSession &ES, StringRef RemotePath) {
4832
if (auto Handle = ES.getExecutorProcessControl().loadDylib(RemotePath.data()))

llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ launchLocalExecutor(llvm::StringRef ExecutablePath);
3636
llvm::Expected<std::unique_ptr<llvm::orc::SimpleRemoteEPC>>
3737
connectTCPSocket(llvm::StringRef NetworkAddress);
3838

39-
llvm::Error addDebugSupport(llvm::orc::ObjectLayer &ObjLayer);
40-
4139
llvm::Expected<std::unique_ptr<llvm::orc::DefinitionGenerator>>
4240
loadDylib(llvm::orc::ExecutionSession &ES, llvm::StringRef RemotePath);
4341

0 commit comments

Comments
 (0)