Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/jit/jit-debugger.c  view on Meta::CPAN

		}
		levent = dbg->events;
	}
	*event = levent->event;
	dbg->events = levent->next;
	if(!(levent->next))
	{
		dbg->last_event = 0;
	}
	jit_free(levent);
	jit_monitor_unlock(&(dbg->queue_lock));
	return 1;
}

/*@
 * @deftypefun jit_debugger_breakpoint_id_t jit_debugger_add_breakpoint (jit_debugger_t @var{dbg}, jit_debugger_breakpoint_info_t @var{info})
 * Add a hard breakpoint to a debugger instance.  The @var{info} structure
 * defines the conditions under which the breakpoint should fire.
 * The fields of @var{info} are as follows:
 *
 * @table @code
 * @item flags
 * Flags that indicate which of the following fields should be matched.
 * If a flag is not present, then all possible values of the field will match.
 * Valid flags are @code{JIT_DEBUGGER_FLAG_THREAD},
 * @code{JIT_DEBUGGER_FLAG_FUNCTION}, @code{JIT_DEBUGGER_FLAG_DATA1},
 * and @code{JIT_DEBUGGER_FLAG_DATA2}.
 *
 * @item thread
 * The thread to match against, if @code{JIT_DEBUGGER_FLAG_THREAD} is set.
 *
 * @item function
 * The function to match against, if @code{JIT_DEBUGGER_FLAG_FUNCTION} is set.
 *
 * @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;



( run in 0.768 second using v1.01-cache-2.11-cpan-119454b85a5 )