]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/JITLoader.h
Merge ^/head r340213 through r340234.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / JITLoader.h
1 //===-- JITLoader.h ---------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_JITLoader_h_
11 #define liblldb_JITLoader_h_
12
13 #include <vector>
14
15 #include "lldb/Core/PluginInterface.h"
16 #include "lldb/Target/JITLoaderList.h"
17
18 namespace lldb_private {
19
20 //----------------------------------------------------------------------
21 /// @class JITLoader JITLoader.h "lldb/Target/JITLoader.h"
22 /// A plug-in interface definition class for JIT loaders.
23 ///
24 /// Plugins of this kind listen for code generated at runtime in the target.
25 /// They are very similar to dynamic loader, with the difference that they do
26 /// not have information about the target's dyld and that there may be
27 /// multiple JITLoader plugins per process, while there is at most one
28 /// DynamicLoader.
29 //----------------------------------------------------------------------
30 class JITLoader : public PluginInterface {
31 public:
32   //------------------------------------------------------------------
33   /// Find a JIT loader plugin for a given process.
34   ///
35   /// Scans the installed DynamicLoader plug-ins and tries to find all
36   /// applicable instances for the current process.
37   ///
38   /// @param[in] process
39   ///     The process for which to try and locate a JIT loader
40   ///     plug-in instance.
41   ///
42   //------------------------------------------------------------------
43   static void LoadPlugins(Process *process, lldb_private::JITLoaderList &list);
44
45   //------------------------------------------------------------------
46   /// Construct with a process.
47   //------------------------------------------------------------------
48   JITLoader(Process *process);
49
50   ~JITLoader() override;
51
52   //------------------------------------------------------------------
53   /// Called after attaching a process.
54   ///
55   /// Allow JITLoader plug-ins to execute some code after attaching to a
56   /// process.
57   //------------------------------------------------------------------
58   virtual void DidAttach() = 0;
59
60   //------------------------------------------------------------------
61   /// Called after launching a process.
62   ///
63   /// Allow JITLoader plug-ins to execute some code after the process has
64   /// stopped for the first time on launch.
65   //------------------------------------------------------------------
66   virtual void DidLaunch() = 0;
67
68   //------------------------------------------------------------------
69   /// Called after a new shared object has been loaded so that it can be
70   /// probed for JIT entry point hooks.
71   //------------------------------------------------------------------
72   virtual void ModulesDidLoad(lldb_private::ModuleList &module_list) = 0;
73
74 protected:
75   //------------------------------------------------------------------
76   // Member variables.
77   //------------------------------------------------------------------
78   Process *m_process;
79 };
80
81 } // namespace lldb_private
82
83 #endif // liblldb_JITLoader_h_