ext/byebug/byebug.c in byebug-2.2.0 vs ext/byebug/byebug.c in byebug-2.2.1

- old
+ new

@@ -35,11 +35,11 @@ int i = 0; VALUE path = rb_tracearg_path(trace_arg); VALUE line = rb_tracearg_lineno(trace_arg); VALUE event = rb_tracearg_event(trace_arg); VALUE mid = rb_tracearg_method_id(trace_arg); - for (i=0; i<dc->stack_size; i++) putc('|', stderr); + for (i=0; i<dc->calced_stack_size; i++) putc('|', stderr); fprintf(stderr, "[#%d] %s@%s:%d %s\n", dc->thnum, rb_id2name(SYM2ID(event)), RSTRING_PTR(path), NUM2INT(line), NIL_P(mid) ? "" : rb_id2name(SYM2ID(mid))); } } @@ -192,11 +192,11 @@ line = rb_tracearg_lineno(trace_arg); binding = rb_tracearg_binding(trace_arg); EVENT_COMMON - if (dc->stack_size == 0) dc->stack_size++; + if (dc->calced_stack_size == 0) dc->calced_stack_size++; if (dc->last_line != rb_tracearg_lineno(trace_arg) || dc->last_file != rb_tracearg_path(trace_arg)) { moved = 1; @@ -206,16 +206,16 @@ call_at_tracing(context, dc, file, line); if (moved || !CTX_FL_TEST(dc, CTX_FL_FORCE_MOVE)) { dc->steps = dc->steps <= 0 ? -1 : dc->steps - 1; - if (dc->stack_size <= dc->dest_frame) + if (dc->calced_stack_size <= dc->dest_frame) { dc->lines = dc->lines <= 0 ? -1 : dc->lines - 1; - if (dc->stack_size < dc->dest_frame) + if (dc->calced_stack_size < dc->dest_frame) { - dc->dest_frame = dc->stack_size; + dc->dest_frame = dc->calced_stack_size; rb_funcall(mByebug, rb_intern("print"), 1, rb_str_new2("Next went up a frame because previous frame finished\n")); } } } @@ -236,11 +236,11 @@ { VALUE breakpoint, klass, mid, binding, self, file, line; EVENT_SETUP - dc->stack_size++; + dc->calced_stack_size++; EVENT_COMMON breakpoint = Qnil; klass = rb_tracearg_defined_class(trace_arg); @@ -263,25 +263,25 @@ static void return_event(VALUE trace_point, void *data) { EVENT_SETUP - if (dc->stack_size > 0) dc->stack_size--; + if (dc->calced_stack_size > 0) dc->calced_stack_size--; EVENT_COMMON - if (dc->stack_size + 1 == dc->before_frame) + if (dc->calced_stack_size + 1 == dc->before_frame) { VALUE file, line; reset_stepping_stop_points(dc); file = rb_tracearg_path(trace_arg); line = rb_tracearg_lineno(trace_arg); call_at_return(context, dc, file, line); } - if (dc->stack_size + 1 == dc->after_frame) + if (dc->calced_stack_size + 1 == dc->after_frame) { reset_stepping_stop_points(dc); dc->steps = 1; } @@ -291,11 +291,11 @@ static void c_call_event(VALUE trace_point, void *data) { EVENT_SETUP - dc->stack_size++; + dc->calced_stack_size++; EVENT_COMMON cleanup(dc); } @@ -303,11 +303,11 @@ static void c_return_event(VALUE trace_point, void *data) { EVENT_SETUP - if (dc->stack_size > 0) dc->stack_size--; + if (dc->calced_stack_size > 0) dc->calced_stack_size--; EVENT_COMMON cleanup(dc); } @@ -344,11 +344,11 @@ rb_debug_inspector_open(context_backtrace_set, (void *)new_dc); } expn_class = rb_obj_class(err); - if (catchpoints == Qnil || dc->stack_size == 0 || + if (catchpoints == Qnil || dc->calced_stack_size == 0 || CTX_FL_TEST(dc, CTX_FL_CATCHING) || RHASH_TBL(catchpoints)->num_entries == 0) { cleanup(dc); return; @@ -604,12 +604,9 @@ context = bb_current_context(self); Data_Get_Struct(context, debug_context_t, dc); if (RTEST(stop)) dc->steps = 1; - - /* Reset stack size to ignore byebug's own frames */ - dc->stack_size = 0; /* Initializing $0 to the script's path */ ruby_script(RSTRING_PTR(file)); rb_load_protect(file, 0, &state); if (0 != state)