Skip to content

Commit bc8cdb7

Browse files
[llvm-jitlink] Don't add the plugin is case of symbol errors
1 parent 6981849 commit bc8cdb7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,13 @@ Session::Session(std::unique_ptr<ExecutorProcessControl> EPC, Error &Err)
12971297
ObjLayer.addPlugin(ExitOnErr(EHFrameRegistrationPlugin::Create(ES)));
12981298
if (DebuggerSupport) {
12991299
Error TargetSymErr = Error::success();
1300-
ObjLayer.addPlugin(std::make_unique<DebugObjectManagerPlugin>(
1301-
ES, true, true, TargetSymErr));
1302-
logAllUnhandledErrors(std::move(TargetSymErr), errs(),
1303-
"Debugger support not available: ");
1300+
auto Plugin = std::make_unique<DebugObjectManagerPlugin>(ES, true, true,
1301+
TargetSymErr);
1302+
if (!TargetSymErr)
1303+
ObjLayer.addPlugin(std::move(Plugin));
1304+
else
1305+
logAllUnhandledErrors(std::move(TargetSymErr), errs(),
1306+
"Debugger support not available: ");
13041307
}
13051308
}
13061309

0 commit comments

Comments
 (0)