450 changes: 0 additions & 450 deletions llvm/lib/ExecutionEngine/Orc/DebuggerSupportPlugin.cpp

This file was deleted.

33 changes: 4 additions & 29 deletions llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ManagedStatic.h"

#include <cstdint>
Expand Down Expand Up @@ -71,18 +70,10 @@ using namespace llvm::orc;
ManagedStatic<std::mutex> JITDebugLock;

// Register debug object, return error message or null for success.
static void registerJITLoaderGDBImpl(const char *ObjAddr, size_t Size) {
LLVM_DEBUG({
dbgs() << "Registering debug object with GDB JIT interface "
<< formatv("([{0:x16} -- {1:x16}])",
reinterpret_cast<uintptr_t>(ObjAddr),
reinterpret_cast<uintptr_t>(ObjAddr + Size))
<< "\n";
});

static void registerJITLoaderGDBImpl(ExecutorAddrRange DebugObjRange) {
jit_code_entry *E = new jit_code_entry;
E->symfile_addr = ObjAddr;
E->symfile_size = Size;
E->symfile_addr = DebugObjRange.Start.toPtr<const char *>();
E->symfile_size = DebugObjRange.size().getValue();
E->prev_entry = nullptr;

std::lock_guard<std::mutex> Lock(*JITDebugLock);
Expand All @@ -102,26 +93,10 @@ static void registerJITLoaderGDBImpl(const char *ObjAddr, size_t Size) {
__jit_debug_register_code();
}

extern "C" orc::shared::CWrapperFunctionResult
llvm_orc_registerJITLoaderGDBAllocAction(const char *Data, size_t Size) {
using namespace orc::shared;
return WrapperFunction<SPSError()>::handle(nullptr, 0,
[=]() -> Error {
registerJITLoaderGDBImpl(Data,
Size);
return Error::success();
})
.release();
}

extern "C" orc::shared::CWrapperFunctionResult
llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size) {
using namespace orc::shared;
return WrapperFunction<void(SPSExecutorAddrRange)>::handle(
Data, Size,
[](ExecutorAddrRange R) {
registerJITLoaderGDBImpl(R.Start.toPtr<char *>(),
R.size().getValue());
})
Data, Size, registerJITLoaderGDBImpl)
.release();
}

This file was deleted.

21 changes: 21 additions & 0 deletions llvm/test/ExecutionEngine/JITLink/X86/MachO_skip_debug_sections.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# REQUIRES: asserts
# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t %s
# RUN: llvm-jitlink -debug-only=jitlink -noexec %t 2>&1 | FileCheck %s
#
# Check that debug sections are not emitted, and consequently that we don't
# error out due to buggy past-the-end anonymous relocations in __debug_ranges.
#
# CHECK: __debug_ranges is a debug section: No graph section will be created.
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 15
.globl _main
.p2align 4, 0x90
_main:
retq
Lpast_the_end:

.section __DWARF,__debug_ranges
.p2align 4
.quad Lpast_the_end

.subsections_via_symbols
8 changes: 1 addition & 7 deletions llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "llvm/BinaryFormat/Magic.h"
#include "llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h"
#include "llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h"
#include "llvm/ExecutionEngine/Orc/ELFNixPlatform.h"
#include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h"
#include "llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h"
Expand Down Expand Up @@ -988,13 +987,8 @@ Session::Session(std::unique_ptr<ExecutorProcessControl> EPC, Error &Err)
ExitOnErr(loadProcessSymbols(*this));
ExitOnErr(loadDylibs(*this));

auto &TT = ES.getExecutorProcessControl().getTargetTriple();

if (TT.isOSBinFormatMachO())
ObjLayer.addPlugin(ExitOnErr(
GDBJITDebugInfoRegistrationPlugin::Create(this->ES, *MainJD, TT)));

// Set up the platform.
auto &TT = ES.getExecutorProcessControl().getTargetTriple();
if (TT.isOSBinFormatMachO() && !OrcRuntime.empty()) {
if (auto P =
MachOPlatform::Create(ES, ObjLayer, *MainJD, OrcRuntime.c_str()))
Expand Down