@@ -333,13 +333,6 @@ process_line_event(VALUE trace_point, void *data)
333333 tp = TRACE_POINT ;
334334 path = rb_tracearg_path (tp );
335335
336- if (context -> stack_size <= context -> init_stack_size && context -> hit_user_code ) {
337- context -> script_finished = 1 ;
338- }
339- if (context -> script_finished ) {
340- return ;
341- }
342-
343336 if (is_path_accepted (path )) {
344337
345338 lineno = rb_tracearg_lineno (tp );
@@ -388,13 +381,18 @@ process_line_event(VALUE trace_point, void *data)
388381 breakpoint = breakpoint_find (breakpoints , path , lineno , trace_point );
389382 if (context -> stop_next == 0 || context -> stop_line == 0 || breakpoint != Qnil ) {
390383 rb_ensure (start_inspector , context_object , stop_inspector , Qnil );
391- context -> stop_reason = CTX_STOP_STEP ;
392- if (breakpoint != Qnil ) {
393- context -> stop_reason = CTX_STOP_BREAKPOINT ;
394- rb_funcall (context_object , idAtBreakpoint , 1 , breakpoint );
384+ if (context -> stack_size <= context -> init_stack_size && context -> hit_user_code ) {
385+ context -> script_finished = 1 ;
386+ }
387+ if (!context -> script_finished ) {
388+ context -> stop_reason = CTX_STOP_STEP ;
389+ if (breakpoint != Qnil ) {
390+ context -> stop_reason = CTX_STOP_BREAKPOINT ;
391+ rb_funcall (context_object , idAtBreakpoint , 1 , breakpoint );
392+ }
393+ reset_stepping_stop_points (context );
394+ call_at_line (context , file , line , context_object );
395395 }
396- reset_stepping_stop_points (context );
397- call_at_line (context , file , line , context_object );
398396 }
399397 }
400398 cleanup (context );
0 commit comments