Ejemplo n.º 1
0
int
check_breakpoint_by_method(VALUE breakpoint, VALUE klass, ID mid, VALUE self)
{
    debug_breakpoint_t *debug_breakpoint;

    if(breakpoint == Qnil)
        return 0;
    Data_Get_Struct(breakpoint, debug_breakpoint_t, debug_breakpoint);
    if (!Qtrue == debug_breakpoint->enabled) return 0;
    if(debug_breakpoint->type != BP_METHOD_TYPE)
        return 0;
    if(debug_breakpoint->pos.mid != mid)
        return 0;
    if(classname_cmp(debug_breakpoint->source, klass))
        return 1;
    if ((rb_type(self) == T_CLASS) &&
        classname_cmp(debug_breakpoint->source, self))
        return 1;
    return 0;
}
Ejemplo n.º 2
0
static int
check_breakpoint_by_method(VALUE rb_breakpoint, VALUE klass, ID mid, VALUE self)
{
  breakpoint_t *breakpoint;

  if (NIL_P(rb_breakpoint))
    return 0;

  Data_Get_Struct(rb_breakpoint, breakpoint_t, breakpoint);

  if (Qfalse == breakpoint->enabled || breakpoint->type != BP_METHOD_TYPE
      || breakpoint->pos.mid != mid)
    return 0;

  if (classname_cmp(breakpoint->source, klass)
      || ((rb_type(self) == T_CLASS || rb_type(self) == T_MODULE)
          && classname_cmp(breakpoint->source, self)))
    return 1;

  return 0;
}