示例#1
0
文件: byebug.c 项目: Xifip/modr
static void
call_event(VALUE trace_point, void *data)
{
  VALUE breakpoint, klass, msym, mid, binding, self, file, line;

  EVENT_SETUP

  dc->calced_stack_size++;

  if (CTX_FL_TEST(dc, CTX_FL_STOP_ON_RET))
    dc->steps_out = dc->steps_out <= 0 ? -1 : dc->steps_out + 1;

  EVENT_COMMON

  breakpoint = Qnil;
  klass   = rb_tracearg_defined_class(trace_arg);
  msym    = rb_tracearg_method_id(trace_arg);
  mid     = NIL_P(msym) ? Qnil : SYM2ID(msym);
  binding = rb_tracearg_binding(trace_arg);
  self    = rb_tracearg_self(trace_arg);
  file    = rb_tracearg_path(trace_arg);
  line    = rb_tracearg_lineno(trace_arg);

  breakpoint = find_breakpoint_by_method(breakpoints, klass, mid, binding, self);
  if (breakpoint != Qnil)
  {
    call_at_breakpoint(context, dc, breakpoint);
    call_at_line(context, dc, file, line);
  }

  cleanup(dc);
}
示例#2
0
static void
call_event(VALUE trace_point, void *data)
{
  VALUE breakpoint, klass, mid, binding, self, file, line;

  EVENT_SETUP

  dc->calced_stack_size++;

  EVENT_COMMON

  breakpoint = Qnil;
  klass   = rb_tracearg_defined_class(trace_arg);
  mid     = SYM2ID(rb_tracearg_method_id(trace_arg));
  binding = rb_tracearg_binding(trace_arg);
  self    = rb_tracearg_self(trace_arg);
  file    = rb_tracearg_path(trace_arg);
  line    = rb_tracearg_lineno(trace_arg);

  breakpoint = find_breakpoint_by_method(breakpoints, klass, mid, binding, self);
  if (breakpoint != Qnil)
  {
    call_at_breakpoint(context, dc, breakpoint);
    call_at_line(context, dc, file, line);
  }

  cleanup(dc);
}
示例#3
0
文件: byebug.c 项目: Xifip/modr
static void
call_at_line_check(VALUE context_obj, debug_context_t *dc,
                   VALUE breakpoint, VALUE file, VALUE line)
{
  dc->stop_reason = CTX_STOP_STEP;

  if (breakpoint != Qnil)
    call_at_breakpoint(context_obj, dc, breakpoint);

  reset_stepping_stop_points(dc);
  call_at_line(context_obj, dc, file, line);
}
示例#4
0
static void
call_at_line_check(VALUE ctx, debug_context_t * dc, VALUE breakpoint)
{
  dc->stop_reason = CTX_STOP_STEP;

  if (!NIL_P(breakpoint))
    call_at_breakpoint(ctx, dc, breakpoint);

  reset_stepping_stop_points(dc);

  call_at_line(ctx, dc);
}
示例#5
0
static void
call_event(VALUE trace_point, void *data)
{
  VALUE brkpnt, klass, msym, mid, binding, self, file, line;

  EVENT_SETUP;

  if (dc->calced_stack_size <= dc->dest_frame)
    CTX_FL_UNSET(dc, CTX_FL_IGNORE_STEPS);

  dc->calced_stack_size++;

  dc->steps_out = dc->steps_out <= 0 ? -1 : dc->steps_out + 1;

  /* nil method_id means we are at top level so there can't be a method
   * breakpoint here. Just leave then. */
  msym = rb_tracearg_method_id(trace_arg);
  if (NIL_P(msym))
  {
    EVENT_TEARDOWN;
    return;
  }

  mid = SYM2ID(msym);
  klass = rb_tracearg_defined_class(trace_arg);
  binding = rb_tracearg_binding(trace_arg);
  self = rb_tracearg_self(trace_arg);
  file = rb_tracearg_path(trace_arg);
  line = rb_tracearg_lineno(trace_arg);

  brkpnt = Qnil;

  if (!NIL_P(breakpoints))
    brkpnt = find_breakpoint_by_method(breakpoints, klass, mid, binding, self);

  if (!NIL_P(brkpnt))
  {
    call_at_breakpoint(context, dc, brkpnt);
    call_at_line(context, dc, file, line);
  }

  EVENT_TEARDOWN;
}