Bug #3843

ruby -r tracer prog.rb no longer tracers prog.rb

Added by Dave Thomas over 4 years ago. Updated almost 4 years ago.

[ruby-core:32448]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:1.9.2 Backport:

Description

=begin
The problem appears to be at the end of tracer.rb:

if $0 == FILE
# direct call

$0 = ARGV[0]
ARGV.shift
Tracer.on
require $0
elsif caller.size <= 1
Tracer.on
end

IN 1.9.2, caller() at this point is 2 deep:

["internal:lib/rubygems/custom_require:29:in require'", "<internal:lib/rubygems/custom_require>:29:inrequire'"]

The following change seems to fix it, but it feels a little hacky..

if $0 == FILE
# direct call

$0 = ARGV[0]
ARGV.shift
Tracer.on
require $0
elsif caller.size <= 2 && caller.all? {|place| place =~ /custom_require/}
Tracer.on
end

Dave
=end


Related issues

Duplicated by Ruby trunk - Bug #3749: -rtracer doesn't trace anymore Closed 08/26/2010

History

#1 Updated by Nobuyoshi Nakada over 4 years ago

  • Status changed from Open to Closed

=begin
This issue was solved with changeset r29280.
Roger, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF