Miasm2
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros
Classes | Functions
miasm2.jitter.jitcore_tcc Namespace Reference

Classes

class  jit_tcc_code
 
class  JitCore_Tcc
 
class  myresolver
 
class  objref
 
class  resolver
 

Functions

def jit_tcc_compil
 
def gen_core
 
def gen_C_source
 

Function Documentation

def miasm2.jitter.jitcore_tcc.gen_C_source (   ir_arch,
  func_code 
)

Definition at line 43 of file jitcore_tcc.py.

43 
44 def gen_C_source(ir_arch, func_code):
45  c_source = ""
46  c_source += "\n".join(func_code)
47 
48  c_source = gen_core(ir_arch.arch, ir_arch.attrib) + c_source
49 
50  c_source = """
51  #ifdef __x86_64__
52  #ifndef __LP64__
53  /*
54  for ubuntu ?!? XXX TODO
55  /!\ force 64 bit system using 64 bits libc
56  change this to __ILP32__ to do so.
57  */
58  #define __LP64__
59  #endif
60  #endif
61  """ + "#include <Python.h>\n" + c_source
62 
63  return c_source
64 

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def miasm2.jitter.jitcore_tcc.gen_core (   arch,
  attrib 
)

Definition at line 27 of file jitcore_tcc.py.

27 
28 def gen_core(arch, attrib):
29  lib_dir = os.path.dirname(os.path.realpath(__file__))
30 
31  txt = ""
32  txt += '#include "%s/queue.h"\n' % lib_dir
33  txt += '#include "%s/vm_mngr.h"\n' % lib_dir
34  txt += '#include "%s/vm_mngr_py.h"\n' % lib_dir
35  txt += '#include "%s/JitCore.h"\n' % lib_dir
36  txt += '#include "%s/arch/JitCore_%s.h"\n' % (lib_dir, arch.name)
37 
38  txt += r'''
39 #define RAISE(errtype, msg) {PyObject* p; p = PyErr_Format( errtype, msg ); return p;}
40 '''
41  return txt
42 

+ Here is the caller graph for this function:

def miasm2.jitter.jitcore_tcc.jit_tcc_compil (   func_name,
  func_code 
)

Definition at line 12 of file jitcore_tcc.py.

12 
13 def jit_tcc_compil(func_name, func_code):
14  global Jittcc
15  c = Jittcc.tcc_compil(func_name, func_code)
16  return c
17 

+ Here is the caller graph for this function: