reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
//===-- JITLoader.h ---------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_JITLoader_h_
#define liblldb_JITLoader_h_

#include <vector>

#include "lldb/Core/PluginInterface.h"
#include "lldb/Target/JITLoaderList.h"

namespace lldb_private {

/// \class JITLoader JITLoader.h "lldb/Target/JITLoader.h"
/// A plug-in interface definition class for JIT loaders.
///
/// Plugins of this kind listen for code generated at runtime in the target.
/// They are very similar to dynamic loader, with the difference that they do
/// not have information about the target's dyld and that there may be
/// multiple JITLoader plugins per process, while there is at most one
/// DynamicLoader.
class JITLoader : public PluginInterface {
public:
  /// Find a JIT loader plugin for a given process.
  ///
  /// Scans the installed DynamicLoader plug-ins and tries to find all
  /// applicable instances for the current process.
  ///
  /// \param[in] process
  ///     The process for which to try and locate a JIT loader
  ///     plug-in instance.
  ///
  static void LoadPlugins(Process *process, lldb_private::JITLoaderList &list);

  /// Construct with a process.
  JITLoader(Process *process);

  ~JITLoader() override;

  /// Called after attaching a process.
  ///
  /// Allow JITLoader plug-ins to execute some code after attaching to a
  /// process.
  virtual void DidAttach() = 0;

  /// Called after launching a process.
  ///
  /// Allow JITLoader plug-ins to execute some code after the process has
  /// stopped for the first time on launch.
  virtual void DidLaunch() = 0;

  /// Called after a new shared object has been loaded so that it can be
  /// probed for JIT entry point hooks.
  virtual void ModulesDidLoad(lldb_private::ModuleList &module_list) = 0;

protected:
  // Member variables.
  Process *m_process;
};

} // namespace lldb_private

#endif // liblldb_JITLoader_h_