diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-11-10 06:47:11 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-11-10 06:47:11 +0000 |
commit | d761f29be29ad5666579cd6399be22ddd8c4fd10 (patch) | |
tree | 3fa76d26a3de05bb939399c39eb9161c641e1e1b /lib/debug.rb | |
parent | 97de3ac1f2886427faec0d15b32af1bcd434f95d (diff) | |
download | ruby-d761f29be29ad5666579cd6399be22ddd8c4fd10.tar.gz ruby-d761f29be29ad5666579cd6399be22ddd8c4fd10.tar.xz ruby-d761f29be29ad5666579cd6399be22ddd8c4fd10.zip |
19991110
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/debug.rb')
-rw-r--r-- | lib/debug.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/debug.rb b/lib/debug.rb index 0a6699f17..244db021e 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -27,6 +27,7 @@ class DEBUGGER__ @last_file = nil @last = [nil, nil] @no_step = nil + @finish_pos = 0 end DEBUG_LAST_CMD = [] @@ -256,9 +257,13 @@ class DEBUGGER__ STDOUT.printf "#%d %s\n", frame_pos, info when /^fi(?:nish)?$/ - @finish_pos = @frames.size - frame_pos - frame_pos = 0 - return + if frame_pos == 0 + STDOUT.print "\"finish\" not meaningful in the outermost frame.\n" + else + @finish_pos = @frames.size - frame_pos + frame_pos = 0 + return + end when /^q(?:uit)?$/ input = readline("really quit? (y/n) ", false) @@ -373,10 +378,10 @@ class DEBUGGER__ @frames.unshift binding when 'return', 'end' + @frames.shift if @frames.size == @finish_pos @stop_next = 1 end - @frames.shift when 'raise' excn_handle(file, line, id, binding) |