ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Attributes | List of all members
GCCJIT Class Reference

provides compilation via gcc and load the compilation result with dlopen/dlsym functions More...

#include <GCCJIT.h>

Inheritance diagram for GCCJIT:
Inheritance graph
[legend]
Collaboration diagram for GCCJIT:
Collaboration graph
[legend]

Public Member Functions

 GCCJIT (bool cleanup=true)
 
virtual ~GCCJIT ()
 
virtual void * translate (std::string code, std::set< std::string > headerpaths, std::set< std::string > librarypaths, std::set< std::string > libraries, std::string &error, bool debug=false)
 translate C code to executable code and return a handle/pointer that identifies the compilation result More...
 
virtual void * getFunction (void *handle, std::string name, std::string &error)
 returns a function pointer to a compiled function from the handle returned by etiss::JIT::translate More...
 
virtual void free (void *handle)
 clean up handled returned by etiss::JIT::translate More...
 
- Public Member Functions inherited from etiss::JIT
 JIT (std::string name)
 
virtual ~JIT ()
 
std::string getName ()
 returns the JIT instance name previously passed to the constructor More...
 

Private Attributes

unsigned id
 
std::string path_
 
bool cleanup_
 

Detailed Description

provides compilation via gcc and load the compilation result with dlopen/dlsym functions

use the option "cleanup" -> "false" to keep code after destruction of a GCCJIT instance

Definition at line 49 of file GCCJIT.h.

Constructor & Destructor Documentation

◆ GCCJIT()

GCCJIT::GCCJIT ( bool  cleanup = true)

Definition at line 54 of file GCCJIT.cpp.

References path_.

◆ ~GCCJIT()

GCCJIT::~GCCJIT ( )
virtual

Definition at line 79 of file GCCJIT.cpp.

References cleanup_, and path_.

Member Function Documentation

◆ free()

void GCCJIT::free ( void *  handle)
virtual

clean up handled returned by etiss::JIT::translate

Implements etiss::JIT.

Definition at line 193 of file GCCJIT.cpp.

◆ getFunction()

void * GCCJIT::getFunction ( void *  handle,
std::string  name,
std::string &  error 
)
virtual

returns a function pointer to a compiled function from the handle returned by etiss::JIT::translate

Implements etiss::JIT.

Definition at line 183 of file GCCJIT.cpp.

◆ translate()

void * GCCJIT::translate ( std::string  code,
std::set< std::string >  headerpaths,
std::set< std::string >  librarypaths,
std::set< std::string >  libraries,
std::string &  error,
bool  debug = false 
)
virtual

translate C code to executable code and return a handle/pointer that identifies the compilation result

Parameters
codegenerated code
headerpathspaths where required header files are located
librarypathspaths where required libraries are located (usually not needed since libraries don't require full linking)
librariesfile names of required libraries (usually not needed since libraries don't require full linking)
errorstring to return additional error information
debugif true then compilation should try to enable gdb to jump into compiled functions

Implements etiss::JIT.

Definition at line 87 of file GCCJIT.cpp.

References NULL, and path_.

Member Data Documentation

◆ cleanup_

bool GCCJIT::cleanup_
private

Definition at line 63 of file GCCJIT.h.

Referenced by ~GCCJIT().

◆ id

unsigned GCCJIT::id
private

Definition at line 61 of file GCCJIT.h.

◆ path_

std::string GCCJIT::path_
private

Definition at line 62 of file GCCJIT.h.

Referenced by GCCJIT(), translate(), and ~GCCJIT().


The documentation for this class was generated from the following files: