ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:51067] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
       [not found] <redmine.issue-14817.20180603144747.3007@ruby-lang.org>
@ 2021-06-18 21:14 ` merch-redmine
  2021-12-14 17:15 ` [ruby-dev:51127] " ko1 (Koichi Sasada)
  1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2021-06-18 21:14 UTC (permalink / raw
  To: ruby-dev

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-dev:51127] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
       [not found] <redmine.issue-14817.20180603144747.3007@ruby-lang.org>
  2021-06-18 21:14 ` [ruby-dev:51067] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters merch-redmine
@ 2021-12-14 17:15 ` ko1 (Koichi Sasada)
  1 sibling, 0 replies; 2+ messages in thread
From: ko1 (Koichi Sasada) @ 2021-12-14 17:15 UTC (permalink / raw
  To: ruby-dev

Issue #14817 has been updated by ko1 (Koichi Sasada).

Status changed from Assigned to Closed

fixed https://github.com/ruby/ruby/pull/4637

----------------------------------------
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-95346

* Author: ktsj (Kazuki Tsujimoto)
* Status: Closed
* 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-14 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-14817.20180603144747.3007@ruby-lang.org>
2021-06-18 21:14 ` [ruby-dev:51067] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters merch-redmine
2021-12-14 17:15 ` [ruby-dev:51127] " ko1 (Koichi Sasada)

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 read-only IMAP folder(s) and NNTP newsgroup(s).