1234971Sdim//===-- JITRegistrar.h - Registers objects with a debugger ----------------===//
2234971Sdim//
3234971Sdim//                     The LLVM Compiler Infrastructure
4234971Sdim//
5234971Sdim// This file is distributed under the University of Illinois Open Source
6234971Sdim// License. See LICENSE.TXT for details.
7234971Sdim//
8234971Sdim//===----------------------------------------------------------------------===//
9234971Sdim
10234971Sdim#ifndef LLVM_EXECUTION_ENGINE_JIT_REGISTRAR_H
11234971Sdim#define LLVM_EXECUTION_ENGINE_JIT_REGISTRAR_H
12234971Sdim
13243830Sdim#include "llvm/ExecutionEngine/ObjectBuffer.h"
14234971Sdim
15234971Sdimnamespace llvm {
16234971Sdim
17234971Sdim/// Global access point for the JIT debugging interface.
18234971Sdimclass JITRegistrar {
19263508Sdim  virtual void anchor();
20234971Sdimpublic:
21234971Sdim  /// Instantiates the JIT service.
22234971Sdim  JITRegistrar() {}
23234971Sdim
24234971Sdim  /// Unregisters each object that was previously registered and releases all
25234971Sdim  /// internal resources.
26234971Sdim  virtual ~JITRegistrar() {}
27234971Sdim
28234971Sdim  /// Creates an entry in the JIT registry for the buffer @p Object,
29234971Sdim  /// which must contain an object file in executable memory with any
30234971Sdim  /// debug information for the debugger.
31243830Sdim  virtual void registerObject(const ObjectBuffer &Object) = 0;
32234971Sdim
33234971Sdim  /// Removes the internal registration of @p Object, and
34234971Sdim  /// frees associated resources.
35234971Sdim  /// Returns true if @p Object was previously registered.
36243830Sdim  virtual bool deregisterObject(const ObjectBuffer &Object) = 0;
37234971Sdim
38234971Sdim  /// Returns a reference to a GDB JIT registrar singleton
39234971Sdim  static JITRegistrar& getGDBRegistrar();
40234971Sdim};
41234971Sdim
42234971Sdim} // end namespace llvm
43234971Sdim
44234971Sdim#endif // LLVM_EXECUTION_ENGINE_JIT_REGISTRAR_H
45