Hello,

> From: Aleksi Niemel [mailto:aleksi.niemela / cinnober.com]
> Sent: Monday, January 08, 2001 10:50 PM

> The other nice feature is that you should be able to set a break point for
> the rescuing code.

You can use catchpoint.

0% cat sample.rb
thread = Thread.new do
  begin
    raise
  rescue 
    p $1
    raise
  end
end
thread.join

0% ruby -rdebug sample.rb
Debug.rb
Emacs support available.

sample.rb:1:thread = Thread.new do
(rdb:1) catch
Catchpoint StandardError.
(rdb:1) cont
sample.rb:3: `' (RuntimeError)
	from /usr/local/lib/ruby/1.6/debug.rb:659:in `excn_handle'
	from /usr/local/lib/ruby/1.6/debug.rb:720:in `trace_func'
	from /usr/local/lib/ruby/1.6/debug.rb:901
	from /usr/local/lib/ruby/1.6/debug.rb:902
	from sample.rb:3
	from sample.rb:1:in `initialize'
	from sample.rb:1:in `new'
	from sample.rb:1
sample.rb:3:    raise
(rdb:2) list
[-2, 7] in sample.rb
   1  thread = Thread.new do
   2    begin
=> 3      raise
   4    rescue 
   5      p $1
   6      raise
   7    end
(rdb:2) cont
nil
sample.rb:6: `' (RuntimeError)
	from sample.rb:1
sample.rb:6:    raise
(rdb:2) list
[1, 10] in sample.rb
   1  thread = Thread.new do
   2    begin
   3      raise
   4    rescue 
   5      p $1
=> 6      raise
   7    end
   8  end
   9  thread.join
(rdb:2) cont
/usr/local/lib/ruby/1.6/debug.rb:109:in `stop': stopping only thread (ThreadError)
	note: use sleep to stop forever
	from /usr/local/lib/ruby/1.6/debug.rb:109:in `check_suspend'
	from /usr/local/lib/ruby/1.6/debug.rb:672:in `trace_func'
	from /usr/local/lib/ruby/1.6/debug.rb:901
	from /usr/local/lib/ruby/1.6/debug.rb:902:in `backtrace'
	from sample.rb:9:in `backtrace'
	from sample.rb:9:in `join'
	from sample.rb:9
1% 

!!! I found a bug in debug.rb.(Above last 'cont' caused
an error regarding thread scheduling)  Definitely it's my
fault.  Sorry matz...

// NaHi