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 
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 // LLDB_TARGET_JITLOADER_H
list
MATCHES FreeBSD list(APPEND FBSDKERNEL_LIBS kvm) endif() if(NOT FBSDKERNEL_LIBS) message(STATUS "Skipping FreeBSDKernel plugin due to missing libfbsdvmcore") return() endif() add_lldb_library(lldbPluginProcessFreeBSDKernel PLUGIN ProcessFreeBSDKernel.cpp RegisterContextFreeBSDKernel_arm64.cpp RegisterContextFreeBSDKernel_i386.cpp RegisterContextFreeBSDKernel_x86_64.cpp ThreadFreeBSDKernel.cpp LINK_LIBS lldbCore lldbTarget $
Definition: Plugins/Process/FreeBSDKernel/CMakeLists.txt:6
lldb_private::JITLoader::DidLaunch
virtual void DidLaunch()=0
Called after launching a process.
lldb_private::JITLoaderList
Definition: JITLoaderList.h:22
lldb_private::JITLoader::LoadPlugins
static void LoadPlugins(Process *process, lldb_private::JITLoaderList &list)
Find a JIT loader plugin for a given process.
Definition: JITLoader.cpp:18
lldb_private::PluginInterface
Definition: PluginInterface.h:16
lldb_private::Process
Definition: Process.h:338
lldb_private::JITLoader::m_process
Process * m_process
Definition: JITLoader.h:63
lldb_private::JITLoader::JITLoader
JITLoader(Process *process)
Construct with a process.
Definition: JITLoader.cpp:30
lldb_private::ModuleList
Definition: ModuleList.h:79
lldb_private::JITLoader::~JITLoader
~JITLoader() override
PluginInterface.h
JITLoaderList.h
lldb_private::JITLoader
Definition: JITLoader.h:27
lldb_private::JITLoader::DidAttach
virtual void DidAttach()=0
Called after attaching a process.
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::JITLoader::ModulesDidLoad
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.