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 liblldb_JITLoader_h_
10 #define liblldb_JITLoader_h_
11 
12 #include <vector>
13 
16 
17 namespace 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.
27 class JITLoader : public PluginInterface {
28 public:
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 
61 protected:
62  // Member variables.
64 };
65 
66 } // namespace lldb_private
67 
68 #endif // liblldb_JITLoader_h_
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
JITLoader(Process *process)
Construct with a process.
Definition: JITLoader.cpp:30
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:91
A plug-in interface definition class for debugging a process.
Definition: Process.h:353
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 DidAttach()=0
Called after attaching a process.
virtual void DidLaunch()=0
Called after launching a process.
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