Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ext/ruby_debug/ruby_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ typedef struct locked_thread_t {

static locked_thread_t *locked_head = NULL;
static locked_thread_t *locked_tail = NULL;
static rb_event_flag_t last_hook_event = RUBY_EVENT_NONE;

/* "Step", "Next" and "Finish" do their work by saving information
about where to stop next. reset_stopping_points removes/resets this
Expand Down Expand Up @@ -876,7 +877,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
if (CTX_FL_TEST(debug_context, CTX_FL_SKIPPED))
goto cleanup;

if ((event == RUBY_EVENT_LINE) && (debug_context->stack_size > 0) &&
if ((event == RUBY_EVENT_LINE) && (last_hook_event == RUBY_EVENT_LINE) && (debug_context->stack_size > 0) &&
(get_top_frame(debug_context)->line == line) && (get_top_frame(debug_context)->info.runtime.cfp->iseq == iseq) &&
!CTX_FL_TEST(debug_context, CTX_FL_CATCHING))
{
Expand All @@ -886,6 +887,8 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
}
}

last_hook_event = event;

if(debug == Qtrue)
fprintf(stderr, "%s:%d [%s] %s\n", file, line, get_event_name(event), rb_id2name(mid));

Expand Down