Project

General

Profile

Actions

Bug #7586

closed

Useless sourceline in DTrace parse__begin and parse__end probes

Added by vo.x (Vit Ondruch) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.0.0dev (2012-12-17 trunk 38422) [x86_64-linux]
Backport:
[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?

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Status changed from Open to Closed

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

Updated by vo.x (Vit Ondruch) over 12 years ago

Thank you for explanation.

Updated by kosaki (Motohiro KOSAKI) over 12 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.

Updated by kosaki (Motohiro KOSAKI) over 12 years ago

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

Updated by vo.x (Vit Ondruch) over 12 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?

Updated by vo.x (Vit Ondruch) over 12 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0