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 | f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef (patch) | |
| tree | 54fac5b90c2ce6664e7017d954add4d06e388a09 /lib/tracer.rb | |
| parent | 3ed65cc170b2af485f59a8bc519f2569765906ca (diff) | |
| download | ruby-f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef.tar.gz ruby-f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef.tar.xz ruby-f0a1ba42c0789c0ed8ce4c6d75dd41a9969cc1ef.zip | |
matz
git-svn-id: http://svn.ruby-lang.org/repos/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 859a6d524..54179dd19 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 |
