ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: merch-redmine@jeremyevans.net
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:51067] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
Date: Fri, 18 Jun 2021 21:14:29 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-92599.20210618211428.3007@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-14817.20180603144747.3007@ruby-lang.org>

Issue #14817 has been updated by jeremyevans0 (Jeremy Evans).


The cause of this issue is the same as #13392. I've verified the pull request I submitted for that issue (https://github.com/ruby/ruby/pull/4588) will also fix this issue.

----------------------------------------
Bug #14817: TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
https://bugs.ruby-lang.org/issues/14817#change-92599

* Author: ktsj (Kazuki Tsujimoto)
* Status: Assigned
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: ruby 2.6.0dev (2018-06-03 master 63562) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
define_methodしたメソッド(bmethod)のcall/returnイベント中にTracePoint#parametersを呼び出すと
以下の結果となります。

```
$ cat t.rb
define_method(:bm) {|a|}

p method_parameters: method(:bm).parameters

trace = TracePoint.new(:call, :return){|tp|
  mid = tp.method_id
  if mid == :bm
    p mid: mid, event: tp.event, tp_parameters: tp.parameters
  end
}
trace.enable{
  bm(0)
}

$ ruby -v t.rb
ruby 2.6.0dev (2018-06-03 master 63562) [x86_64-linux]
{:method_parameters=>[[:req, :a]]}
{:mid=>:bm, :event=>:call, :tp_parameters=>[[:req, :a]]}
{:mid=>:bm, :event=>:return, :tp_parameters=>[]}         #=> expected: {:mid=>:bm, :event=>:return, :tp_parameters=>[[:req, :a]]}
```

現状、callイベントに限ってその戻り値がbmethodのMethod#parametersの呼び出し結果と一致しますが
returnイベント時も同様となるべきだと思います。




-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2021-06-18 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-14817.20180603144747.3007@ruby-lang.org>
2021-06-18 21:14 ` merch-redmine [this message]
2021-12-14 17:15 ` [ruby-dev:51127] " ko1 (Koichi Sasada)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-92599.20210618211428.3007@ruby-lang.org \
    --to=merch-redmine@jeremyevans.net \
    --cc=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).