summaryrefslogtreecommitdiff
path: root/lib/debug.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-05 02:52:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-03-05 02:52:43 +0000
commit413db1b036083f76a2b34895af3c8a3204e174f2 (patch)
tree9a8cd60d77430f445e121cd509652fe0323af3f8 /lib/debug.rb
parent772c19298d6046b69917035f56253c99c77a4c35 (diff)
* lib/debug.rb: require 'continuation' to implement "restart"
command. [ruby-dev:33992] * lib/debug.rb (Context::debug_command): remove local variable shadowing to shut up warnings. [ruby-dev:33992] * lib/debug.rb (Context::display_list): ditto. * lib/debug.rb (Context::resume): ditto. * lib/debug.rb (Context::get_thread): no longer use #index for Hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/debug.rb')
-rw-r--r--lib/debug.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/debug.rb b/lib/debug.rb
index 1b5f2a2bb6..aeebbc5f8c 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -2,6 +2,8 @@
# Copyright (C) 2000 Information-technology Promotion Agency, Japan
# Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+require 'continuation'
+
if $SAFE > 0
STDERR.print "-r debug.rb is not available in safe mode\n"
exit 1
@@ -295,7 +297,7 @@ class Context
if break_points.find{|b| b[1] == 0}
n = 1
stdout.print "Breakpoints:\n"
- for b in break_points
+ break_points.each do |b|
if b[0] and b[1] == 0
stdout.printf " %d %s:%s\n", n, b[2], b[3]
end
@@ -591,7 +593,6 @@ EOHELP
def display_list(b, e, file, line)
stdout.printf "[%d, %d] in %s\n", b, e, file
if lines = SCRIPT_LINES__[file] and lines != true
- n = 0
b.upto(e) do |n|
if n > 0 && lines[n-1]
if n == line
@@ -780,7 +781,7 @@ class << DEBUGGER__
def resume
MUTEX.synchronize do
make_thread_list
- for th, in @thread_list
+ @thread_list.each do |th,|
next if th == Thread.current
context(th).clear_suspend
end
@@ -806,7 +807,7 @@ class << DEBUGGER__
end
def get_thread(num)
- th = @thread_list.index(num)
+ th = @thread_list.key(num)
unless th
@stdout.print "No thread ##{num}\n"
throw :debug_error