Skip to content
This repository
Browse code

Fix step-out bug.

  • Loading branch information...
commit 68b1b139905da724f765fe13443d48eb4ade3797 1 parent 8bb85f6
Jonathan Worthington authored

Showing 1 changed file with 10 additions and 6 deletions. Show diff stats Hide diff stats

  1. +10 6 lib/Debugger/UI/CommandLine.pm
16 lib/Debugger/UI/CommandLine.pm
@@ -352,10 +352,10 @@ my class DebugState {
352 352 ENTER $in_prompt = True;
353 353 LEAVE $in_prompt = False;
354 354 my $depth = +lines(Backtrace.new().full) - 1;
355   - if $depth < %stepping_over_in<depth> ||
356   - $filename eq %stepping_over_in<file> &&
  355 + if $filename eq %stepping_over_in<file> &&
357 356 %sources{$filename}.routine_containing($from, $to) eq %stepping_over_in<routine> &&
358   - $depth == %stepping_over_in<depth> {
  357 + $depth == %stepping_over_in<depth>
  358 + || $depth < %stepping_over_in<depth> {
359 359 $run_mode = Step;
360 360 %stepping_over_in = ();
361 361 True
@@ -365,8 +365,9 @@ my class DebugState {
365 365 }
366 366 }
367 367 when StepOut {
368   - if $filename ne %stepping_out_of<file> ||
369   - %sources{$filename}.routine_containing($from, $to) ne %stepping_out_of<routine> {
  368 + if ($filename ne %stepping_out_of<file> ||
  369 + %sources{$filename}.routine_containing($from, $to) ne %stepping_out_of<routine>)
  370 + && (+lines(Backtrace.new().full) - 1) < %stepping_out_of<depth> {
370 371 $run_mode = Step;
371 372 %stepping_out_of = ();
372 373 True
@@ -484,7 +485,10 @@ my class DebugState {
484 485 else {
485 486 if %sources{$cur_file}.routine_containing($from, $to) -> $cur_routine {
486 487 $run_mode = StepOut;
487   - %stepping_out_of = file => $cur_file, routine => $cur_routine;
  488 + %stepping_out_of =
  489 + file => $cur_file,
  490 + routine => $cur_routine,
  491 + depth => +lines(Backtrace.new().full) - 4;
488 492 return;
489 493 }
490 494 else {

0 comments on commit 68b1b13

Please sign in to comment.
Something went wrong with that request. Please try again.