LLVM API Documentation

JITRegistrar.h
Go to the documentation of this file.
00001 //===-- JITRegistrar.h - Registers objects with a debugger ----------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_JITREGISTRAR_H
00011 #define LLVM_LIB_EXECUTIONENGINE_RUNTIMEDYLD_JITREGISTRAR_H
00012 
00013 #include "llvm/ExecutionEngine/ObjectBuffer.h"
00014 
00015 namespace llvm {
00016 
00017 /// Global access point for the JIT debugging interface.
00018 class JITRegistrar {
00019   virtual void anchor();
00020 public:
00021   /// Instantiates the JIT service.
00022   JITRegistrar() {}
00023 
00024   /// Unregisters each object that was previously registered and releases all
00025   /// internal resources.
00026   virtual ~JITRegistrar() {}
00027 
00028   /// Creates an entry in the JIT registry for the buffer @p Object,
00029   /// which must contain an object file in executable memory with any
00030   /// debug information for the debugger.
00031   virtual void registerObject(const ObjectBuffer &Object) = 0;
00032 
00033   /// Removes the internal registration of @p Object, and
00034   /// frees associated resources.
00035   /// Returns true if @p Object was previously registered.
00036   virtual bool deregisterObject(const ObjectBuffer &Object) = 0;
00037 
00038   /// Returns a reference to a GDB JIT registrar singleton
00039   static JITRegistrar& getGDBRegistrar();
00040 };
00041 
00042 } // end namespace llvm
00043 
00044 #endif