LLVM 22.0.0git
EPCDebugObjectRegistrar.h
Go to the documentation of this file.
1//===- EPCDebugObjectRegistrar.h - EPC-based debug registration -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// ExecutorProcessControl based registration of debug objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_EPCDEBUGOBJECTREGISTRAR_H
14#define LLVM_EXECUTIONENGINE_ORC_EPCDEBUGOBJECTREGISTRAR_H
15
20#include "llvm/Support/Error.h"
21#include "llvm/Support/Memory.h"
22
23#include <cstdint>
24#include <memory>
25
26namespace llvm {
27namespace orc {
28
29class ExecutionSession;
30
31/// Abstract interface for registering debug objects in the executor process.
33public:
35 bool AutoRegisterCode) = 0;
36 virtual ~DebugObjectRegistrar() = default;
37};
38
39/// Use ExecutorProcessControl to register debug objects locally or in a remote
40/// executor process.
42public:
44 : ES(ES), RegisterFn(RegisterFn) {}
45
46 Error registerDebugObject(ExecutorAddrRange TargetMem,
47 bool AutoRegisterCode) override;
48
49private:
51 ExecutorAddr RegisterFn;
52};
53
54/// Create a ExecutorProcessControl-based DebugObjectRegistrar that emits debug
55/// objects to the GDB JIT interface. This will use the EPC's lookupSymbols
56/// method to find the registration/deregistration function addresses by name.
57///
58/// If RegistrationFunctionsDylib is non-None then it will be searched to find
59/// the registration functions. If it is None then the process dylib will be
60/// loaded to find the registration functions.
63 ExecutionSession &ES,
64 std::optional<ExecutorAddr> RegistrationFunctionDylib = std::nullopt);
65
66} // end namespace orc
67} // end namespace llvm
68
69#endif // LLVM_EXECUTIONENGINE_ORC_EPCDEBUGOBJECTREGISTRAR_H
#define LLVM_ABI
Definition: Compiler.h:213
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
Tagged union holding either a T or a Error.
Definition: Error.h:485
Abstract interface for registering debug objects in the executor process.
virtual Error registerDebugObject(ExecutorAddrRange TargetMem, bool AutoRegisterCode)=0
virtual ~DebugObjectRegistrar()=default
Use ExecutorProcessControl to register debug objects locally or in a remote executor process.
EPCDebugObjectRegistrar(ExecutionSession &ES, ExecutorAddr RegisterFn)
An ExecutionSession represents a running JIT program.
Definition: Core.h:1355
Represents an address in the executor process.
LLVM_ABI Expected< std::unique_ptr< EPCDebugObjectRegistrar > > createJITLoaderGDBRegistrar(ExecutionSession &ES, std::optional< ExecutorAddr > RegistrationFunctionDylib=std::nullopt)
Create a ExecutorProcessControl-based DebugObjectRegistrar that emits debug objects to the GDB JIT in...
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Represents an address range in the exceutor process.