Alien-LibJIT
view release on metacpan or search on metacpan
libjit/jit/jit-debugger.c view on Meta::CPAN
*
* @item data1
* The @code{data1} value to match against, if @code{JIT_DEBUGGER_FLAG_DATA1}
* is set.
*
* @item data2
* The @code{data2} value to match against, if @code{JIT_DEBUGGER_FLAG_DATA2}
* is set.
* @end table
*
* The following special values for @code{data1} are recommended for marking
* breakpoint locations with @code{jit_insn_mark_breakpoint}:
*
* @table @code
* @item JIT_DEBUGGER_DATA1_LINE
* Breakpoint location that corresponds to a source line. This is used
* to determine where to continue to upon a "step".
*
* @item JIT_DEBUGGER_DATA1_ENTER
* Breakpoint location that corresponds to the start of a function.
*
* @item JIT_DEBUGGER_DATA1_LEAVE
* Breakpoint location that corresponds to the end of a function, just
* prior to a @code{return} statement. This is used to determine where
* to continue to upon a "finish".
*
* @item JIT_DEBUGGER_DATA1_THROW
* Breakpoint location that corresponds to an exception throw.
* @end table
* @end deftypefun
@*/
jit_debugger_breakpoint_id_t jit_debugger_add_breakpoint
(jit_debugger_t dbg, jit_debugger_breakpoint_info_t info)
{
/* TODO */
return 0;
}
/*@
* @deftypefun void jit_debugger_remove_breakpoint (jit_debugger_t @var{dbg}, jit_debugger_breakpoint_id_t @var{id})
* Remove a previously defined breakpoint from a debugger instance.
* @end deftypefun
@*/
void jit_debugger_remove_breakpoint
(jit_debugger_t dbg, jit_debugger_breakpoint_id_t id)
{
/* TODO */
}
/*@
* @deftypefun void jit_debugger_remove_all_breakpoints (jit_debugger_t @var{dbg})
* Remove all breakpoints from a debugger instance.
* @end deftypefun
@*/
void jit_debugger_remove_all_breakpoints(jit_debugger_t dbg)
{
/* TODO */
}
/*@
* @deftypefun int jit_debugger_is_alive (jit_debugger_t @var{dbg}, jit_debugger_thread_id_t @var{thread})
* Determine if a particular thread is still alive.
* @end deftypefun
@*/
int jit_debugger_is_alive(jit_debugger_t dbg, jit_debugger_thread_id_t thread)
{
/* TODO */
return 1;
}
/*@
* @deftypefun int jit_debugger_is_running (jit_debugger_t @var{dbg}, jit_debugger_thread_id_t @var{thread})
* Determine if a particular thread is currently running (non-zero) or
* stopped (zero).
* @end deftypefun
@*/
int jit_debugger_is_running(jit_debugger_t dbg, jit_debugger_thread_id_t thread)
{
jit_debugger_thread_t th;
int flag = 0;
lock_debugger(dbg);
th = get_specific_thread(dbg, thread);
if(th)
{
flag = (th->run_type != JIT_RUN_TYPE_STOPPED);
}
unlock_debugger(dbg);
return flag;
}
/*@
* @deftypefun void jit_debugger_run (jit_debugger_t @var{dbg}, jit_debugger_thread_id_t @var{thread})
* Start the specified thread running, or continue from the last breakpoint.
*
* This function, and the others that follow, sends a request to the specified
* thread and then returns to the caller immediately.
* @end deftypefun
@*/
void jit_debugger_run(jit_debugger_t dbg, jit_debugger_thread_id_t thread)
{
jit_debugger_thread_t th;
lock_debugger(dbg);
th = get_specific_thread(dbg, thread);
if(th && th->run_type == JIT_RUN_TYPE_STOPPED)
{
th->run_type = JIT_RUN_TYPE_CONTINUE;
wakeup_all(dbg);
}
unlock_debugger(dbg);
}
/*@
* @deftypefun void jit_debugger_step (jit_debugger_t @var{dbg}, jit_debugger_thread_id_t @var{thread})
* Step over a single line of code. If the line performs a method call,
* then this will step into the call. The request will be ignored if
* the thread is currently running.
* @end deftypefun
@*/
void jit_debugger_step(jit_debugger_t dbg, jit_debugger_thread_id_t thread)
{
jit_debugger_thread_t th;
lock_debugger(dbg);
th = get_specific_thread(dbg, thread);
if(th && th->run_type == JIT_RUN_TYPE_STOPPED)
{
( run in 0.578 second using v1.01-cache-2.11-cpan-df04353d9ac )