diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-12-22 03:22:25 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-12-22 03:22:25 +0000 |
commit | 0e47c138c9bba4396fc7d956b05e5725000012f1 (patch) | |
tree | 54fac5b90c2ce6664e7017d954add4d06e388a09 /lib/tracer.rb | |
parent | 31c53aaa7dc3da8bc9ba6b3007c183dcbeeafe11 (diff) | |
download | ruby-0e47c138c9bba4396fc7d956b05e5725000012f1.tar.gz |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tracer.rb')
-rw-r--r-- | lib/tracer.rb | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/tracer.rb b/lib/tracer.rb index 859a6d5249..54179dd193 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -31,7 +31,10 @@ class Tracer "call" => ">", "return" => "<", "class" => "C", - "end" => "E"} + "end" => "E", + "c-call" => ">", + "c-return" => "<", + } def initialize @threads = Hash.new @@ -59,8 +62,8 @@ class Tracer off end else - set_trace_func proc{|event, file, line, id, binding, klass| - trace_func event, file, line, id, binding + set_trace_func proc{|event, file, line, id, binding, klass, *rest| + trace_func event, file, line, id, binding, klass } stdout.print "Trace on\n" if Tracer.verbose? end @@ -85,7 +88,6 @@ class Tracer end unless list = LINES__[file] -# stdout.print file if $DEBUG begin f = open(file) begin @@ -112,21 +114,21 @@ class Tracer end end - def trace_func(event, file, line, id, binding) + def trace_func(event, file, line, id, binding, klass) return if file == MY_FILE_NAME - #stdout.printf "Th: %s\n", Thread.current.inspect for p in @filters - return unless p.call event, file, line, id, binding + return unless p.call event, file, line, id, binding, klass end Thread.critical = true - stdout.printf("#%d:%s:%d:%s: %s", - get_thread_no, - file, - line, - EVENT_SYMBOL[event], - get_line(file, line)) + stdout.printf("#%d:%s:%d:%s:%s: %s", + get_thread_no, + file, + line, + klass || '', + EVENT_SYMBOL[event], + get_line(file, line)) Thread.critical = false end |