Project

General

Profile

Bug #7586

Useless sourceline in DTrace parse__begin and parse__end probes

Added by Vit Ondruch about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
ruby -v:
ruby 2.0.0dev (2012-12-17 trunk 38422) [x86_64-linux]
Backport:
2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
[ruby-core:50964]

Description

I am not 100% sure, but isn't the 'parser->parser_ruby_sourceline' at https://github.com/ruby/ruby/blob/trunk/parse.y#L5322 always '1'? Does it make sense to pass this information to DTrace parse_begin(const char *, int) and parse_end(const char *, int) probes?

History

#1 [ruby-core:50975] Updated by Nobuyoshi Nakada about 3 years ago

  • Status changed from Open to Closed

It can be other than 1 if the line number is given to eval.

#2 [ruby-core:50976] Updated by Vit Ondruch about 3 years ago

Thank you for explanation.

#3 [ruby-core:50977] Updated by Motohiro KOSAKI about 3 years ago

I think we don't pass 1 when no line information. 0 or -1 is better. and need to be documented when such special line number is happen.

#4 [ruby-core:50979] Updated by Motohiro KOSAKI about 3 years ago

s/don't pass/souldn't pass/

#5 [ruby-core:50984] Updated by Vit Ondruch about 3 years ago

kosaki (Motohiro KOSAKI) wrote:

I think we don't pass 1 when no line information. 0 or -1 is better. and need to be documented when such special line number is happen.

May be it could be worth of own issue?

#6 [ruby-core:50985] Updated by Vit Ondruch about 3 years ago

=begin
Just FYI, this is the output I get testing with SystemTap:

# stap -e 'probe ruby.parse.begin { printf("*** file: %s line: %d\n", parsedfile, parsedline) }' -c 'ruby --disable-gems -e "eval \"puts 1234\", nil, \"foo\", 8"'
1234
*** file: internal:prelude line: 1
*** file: internal:enc/prelude line: 1
*** file: internal:gem_prelude line: 1
*** file: -e line: 1
*** file: foo line: 8

=end

Also available in: Atom PDF