]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
add jit_insn_mark_breakpoint_variable() function.
authorAleksey Demakov <ademakov@gmail.com>
Fri, 15 Sep 2006 16:17:20 +0000 (16:17 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Fri, 15 Sep 2006 16:17:20 +0000 (16:17 +0000)
ChangeLog
include/jit/jit-insn.h
jit/jit-debugger.c
jit/jit-insn.c

index 2abc9c29e3226a74b32e51feed40d25fd238d797..c670ed39f1af856a5655a0caf7b9b241e6230bd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-15  Radek Polak <psonek2@seznam.cz>
+
+        * include/jit/jit-insn.h, jit/jit-insn.c, jit/jit-debugger.c: new
+        instruction jit_insn_mark_breakpoint_variable.
+
 2006-09-14  Aleksey Demakov  <ademakov@gmail.com>
 
        * jit/jit-reg-alloc.h, jit/jit-reg-alloc.c: remove "old" register
index 7b1933c9908b657a04ae1792ae07d4df3e9d125a..9a3ace3daef772e10d55f61fa104f0dd69d43af4 100644 (file)
@@ -317,6 +317,8 @@ int jit_insn_mark_offset
        (jit_function_t func, jit_int offset) JIT_NOTHROW;
 int jit_insn_mark_breakpoint
        (jit_function_t func, jit_nint data1, jit_nint data2) JIT_NOTHROW;
+int jit_insn_mark_breakpoint_variable
+       (jit_function_t func, jit_value_t data1, jit_value_t data2) JIT_NOTHROW;
 
 void jit_insn_iter_init(jit_insn_iter_t *iter, jit_block_t block) JIT_NOTHROW;
 void jit_insn_iter_init_last
index 45d71c5f1c9e2466d1c0b8781bf26a48f42f2227..03e79eafe852c75dc745b703e8c5559b4d43d256 100644 (file)
@@ -125,6 +125,12 @@ of the event is set to the value of @code{stop_immediately} for the call.
 A thread called @code{jit_debugger_detach_self}.
 @end table
 
+@deftypefun int jit_insn_mark_breakpoint_variable (jit_function_t func, jit_value_t data1, jit_value_t data2)
+This function is similar to @code{jit_insn_mark_breakpoint} except that values
+in @code{data1} and @code{data2} can be computed at runtime. You can use this
+function for example to get address of local variable.
+@end deftypefun
+
 @*/
 
 /*
index 1f031d24fb246a65b66e732b2cdc8e28e25b428d..9dfd78bd51caf5a182146ff84d6894503448f1cc 100644 (file)
@@ -8024,9 +8024,9 @@ int jit_insn_mark_offset(jit_function_t func, jit_int offset)
                                                                (func, jit_type_int, offset));
 }
 
-/* Documentation is in jit-debug.c */
-int jit_insn_mark_breakpoint
-       (jit_function_t func, jit_nint data1, jit_nint data2)
+/* Documentation is in jit-debugger.c */
+int jit_insn_mark_breakpoint_variable
+       (jit_function_t func, jit_value_t data1, jit_value_t data2)
 {
 #if defined(JIT_BACKEND_INTERP)
        /* Use the "mark_breakpoint" instruction for the interpreter */
@@ -8034,11 +8034,7 @@ int jit_insn_mark_breakpoint
        {
                return 0;
        }
-       return create_note(func, JIT_OP_MARK_BREAKPOINT,
-                                      jit_value_create_nint_constant
-                                                       (func, jit_type_nint, data1),
-                                      jit_value_create_nint_constant
-                                                       (func, jit_type_nint, data2));
+       return create_note(func, JIT_OP_MARK_BREAKPOINT, data1, data2);
 #else
        /* Insert a call to "_jit_debugger_hook" on native platforms */
        jit_type_t params[3];
@@ -8059,18 +8055,8 @@ int jit_insn_mark_breakpoint
                jit_type_free(signature);
                return 0;
        }
-       if((values[1] = jit_value_create_nint_constant
-                       (func, jit_type_nint, data1)) == 0)
-       {
-               jit_type_free(signature);
-               return 0;
-       }
-       if((values[2] = jit_value_create_nint_constant
-                       (func, jit_type_nint, data2)) == 0)
-       {
-               jit_type_free(signature);
-               return 0;
-       }
+       values[1] = data1;
+       values[2] = data2;
        jit_insn_call_native(func, "_jit_debugger_hook", (void *)_jit_debugger_hook,
                                                 signature, values, 3, JIT_CALL_NOTHROW);
        jit_type_free(signature);
@@ -8078,6 +8064,26 @@ int jit_insn_mark_breakpoint
 #endif
 }
 
+/* Documentation is in jit-debugger.c */
+int jit_insn_mark_breakpoint
+       (jit_function_t func, jit_nint data1, jit_nint data2)
+{
+       jit_value_t value1;
+       jit_value_t value2;
+
+       value1 = jit_value_create_nint_constant(func, jit_type_nint, data1);
+       value2 = jit_value_create_nint_constant(func, jit_type_nint, data2);
+
+       if(value1 && value2)
+       {
+               return jit_insn_mark_breakpoint_variable(func, value1, value2);
+       }
+       else
+       {
+               return 0;
+       }
+}
+
 /*@
  * @deftypefun void jit_insn_iter_init ({jit_insn_iter_t *} iter, jit_block_t block)
  * Initialize an iterator to point to the first instruction in @code{block}.