mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
If $DEBUG == true and some exception is caused in a callback
operation, Ruby/Tk shows a (verbose) backtrace information on the callback process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0ed68132e5
commit
6559430fb7
2 changed files with 23 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Thu Oct 16 23:51:04 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* ext/tk/lib/tk.rb: If $DEBUG == true and some exception is caused
|
||||||
|
in a callback operation, Ruby/Tk shows a (verbose) backtrace
|
||||||
|
information on the callback process.
|
||||||
|
|
||||||
Thu Oct 16 16:54:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Thu Oct 16 16:54:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (rb_str_upto): ("a"..."a").to_a should return [].
|
* string.c (rb_str_upto): ("a"..."a").to_a should return [].
|
||||||
|
|
|
@ -772,7 +772,23 @@ module TkCore
|
||||||
#_get_eval_string(TkUtil.eval_cmd(TkCore::INTERP.tk_cmd_tbl[arg.shift],
|
#_get_eval_string(TkUtil.eval_cmd(TkCore::INTERP.tk_cmd_tbl[arg.shift],
|
||||||
# *arg))
|
# *arg))
|
||||||
cb_obj = TkCore::INTERP.tk_cmd_tbl[arg.shift]
|
cb_obj = TkCore::INTERP.tk_cmd_tbl[arg.shift]
|
||||||
cb_obj.call(*arg)
|
unless $DEBUG
|
||||||
|
cb_obj.call(*arg)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
raise 'check backtrace'
|
||||||
|
rescue
|
||||||
|
# ignore backtrace before 'callback'
|
||||||
|
pos = -($!.backtrace.size)
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
cb_obj.call(*arg)
|
||||||
|
rescue
|
||||||
|
trace = $!.backtrace
|
||||||
|
raise $!, "\n#{trace[0]}: #{$!.message} (#{$!.class})\n" +
|
||||||
|
"\tfrom #{trace[1..pos].join("\n\tfrom ")}"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_cmd_on_ip(tk_cmd)
|
def load_cmd_on_ip(tk_cmd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue