Skip to content

Commit

Permalink
Should definitely fix #93
Browse files Browse the repository at this point in the history
Our calced_stack_size should be reliable enough at this stage (I'm
getting some failures in 2.0 I think due to missing backports but it's
ok for now). It also has the advantage that we can easily "fake it" to
properly ignore byebug internal frames.
  • Loading branch information
David Rodríguez committed Dec 3, 2014
1 parent 0bc618a commit 66dc5d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ext/byebug/byebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ bb_load(int argc, VALUE * argv, VALUE self)
context = bb_current_context(self);
Data_Get_Struct(context, debug_context_t, dc);

dc->calced_stack_size = 0;

if (RTEST(stop))
dc->steps = 1;

Expand Down
5 changes: 2 additions & 3 deletions ext/byebug/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dc_backtrace(const debug_context_t * context)
static int
dc_stack_size(const debug_context_t * context)
{
return RARRAY_LENINT(dc_backtrace(context));
return context->calced_stack_size;
}

extern VALUE
Expand All @@ -64,9 +64,8 @@ context_create(VALUE thread)
reset_stepping_stop_points(context);
context->stop_reason = CTX_STOP_NONE;

rb_debug_inspector_open(context_backtrace_set, (void *)context);
context->calced_stack_size = dc_stack_size(context);
context->backtrace = Qnil;
context->calced_stack_size = 0;

if (rb_obj_class(thread) == cDebugThread)
CTX_FL_SET(context, CTX_FL_IGNORE);
Expand Down

0 comments on commit 66dc5d2

Please sign in to comment.