blob: 69e9dbe490d62302f2a489b5fff07af176618af5 [file] [log] [blame]
Preston Gurd482f8782012-04-16 22:26:48 +00001//===-- JITRegistrar.h - Registers objects with a debugger ----------------===//
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 LLVM_EXECUTION_ENGINE_JIT_REGISTRAR_H
11#define LLVM_EXECUTION_ENGINE_JIT_REGISTRAR_H
12
Andrew Kaylor3f23cef2012-10-02 21:18:39 +000013#include "llvm/ExecutionEngine/ObjectBuffer.h"
Preston Gurd482f8782012-04-16 22:26:48 +000014
15namespace llvm {
16
17/// Global access point for the JIT debugging interface.
18class JITRegistrar {
19public:
20 /// Instantiates the JIT service.
21 JITRegistrar() {}
22
23 /// Unregisters each object that was previously registered and releases all
24 /// internal resources.
25 virtual ~JITRegistrar() {}
26
27 /// Creates an entry in the JIT registry for the buffer @p Object,
28 /// which must contain an object file in executable memory with any
29 /// debug information for the debugger.
Andrew Kaylor3f23cef2012-10-02 21:18:39 +000030 virtual void registerObject(const ObjectBuffer &Object) = 0;
Preston Gurd482f8782012-04-16 22:26:48 +000031
32 /// Removes the internal registration of @p Object, and
33 /// frees associated resources.
34 /// Returns true if @p Object was previously registered.
Andrew Kaylor3f23cef2012-10-02 21:18:39 +000035 virtual bool deregisterObject(const ObjectBuffer &Object) = 0;
Preston Gurd482f8782012-04-16 22:26:48 +000036
37 /// Returns a reference to a GDB JIT registrar singleton
38 static JITRegistrar& getGDBRegistrar();
39};
40
41} // end namespace llvm
42
43#endif // LLVM_EXECUTION_ENGINE_JIT_REGISTRAR_H