LLDB mainline
JITLoader.h
Go to the documentation of this file.
1//===-- JITLoader.h ---------------------------------------------*- 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#ifndef LLDB_TARGET_JITLOADER_H
10#define LLDB_TARGET_JITLOADER_H
11
12#include <vector>
13
16
17namespace lldb_private {
18
19/// \class JITLoader JITLoader.h "lldb/Target/JITLoader.h"
20/// A plug-in interface definition class for JIT loaders.
21///
22/// Plugins of this kind listen for code generated at runtime in the target.
23/// They are very similar to dynamic loader, with the difference that they do
24/// not have information about the target's dyld and that there may be
25/// multiple JITLoader plugins per process, while there is at most one
26/// DynamicLoader.
27class JITLoader : public PluginInterface {
28public:
29 /// Find a JIT loader plugin for a given process.
30 ///
31 /// Scans the installed DynamicLoader plug-ins and tries to find all
32 /// applicable instances for the current process.
33 ///
34 /// \param[in] process
35 /// The process for which to try and locate a JIT loader
36 /// plug-in instance.
37 ///
38 static void LoadPlugins(Process *process, lldb_private::JITLoaderList &list);
39
40 /// Construct with a process.
41 JITLoader(Process *process);
42
43 ~JITLoader() override;
44
45 /// Called after attaching a process.
46 ///
47 /// Allow JITLoader plug-ins to execute some code after attaching to a
48 /// process.
49 virtual void DidAttach() = 0;
50
51 /// Called after launching a process.
52 ///
53 /// Allow JITLoader plug-ins to execute some code after the process has
54 /// stopped for the first time on launch.
55 virtual void DidLaunch() = 0;
56
57 /// Called after a new shared object has been loaded so that it can be
58 /// probed for JIT entry point hooks.
59 virtual void ModulesDidLoad(lldb_private::ModuleList &module_list) = 0;
60
61protected:
62 // Member variables.
64};
65
66} // namespace lldb_private
67
68#endif // LLDB_TARGET_JITLOADER_H
Class used by the Process to hold a list of its JITLoaders.
Definition: JITLoaderList.h:22
A plug-in interface definition class for JIT loaders.
Definition: JITLoader.h:27
virtual void ModulesDidLoad(lldb_private::ModuleList &module_list)=0
Called after a new shared object has been loaded so that it can be probed for JIT entry point hooks.
virtual void DidLaunch()=0
Called after launching a process.
virtual void DidAttach()=0
Called after attaching a process.
static void LoadPlugins(Process *process, lldb_private::JITLoaderList &list)
Find a JIT loader plugin for a given process.
Definition: JITLoader.cpp:18
A collection class for Module objects.
Definition: ModuleList.h:103
A plug-in interface definition class for debugging a process.
Definition: Process.h:341
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14