228件ヒット
[1-100件を表示]
(0.075秒)
クラス
-
IRB
:: Frame (12) - Thread (24)
- TracePoint (12)
- Tracer (48)
モジュール
- Kernel (48)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (12) - TracePoint (12)
-
add
_ filter (24) -
add
_ trace _ func (12) -
call
_ trace _ func (12) - caller (36)
-
defined
_ class (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
set
_ trace _ func (36) - tracer (12)
検索結果
先頭5件
- static void call
_ trace _ func(char *event , NODE *pos , VALUE self , ID id , VALUE klass) - Tracer
# trace _ func(event , file , line , id , binding , klass , *) -> object | nil - Tracer
. trace _ func(*vars) -> object | nil - IRB
:: Frame # trace _ func(event , file , line , id , binding) -> Binding - Kernel
. # set _ trace _ func(proc) -> Proc
-
static void call
_ trace _ func(char *event , NODE *pos , VALUE self , ID id , VALUE klass) (32216.0) -
評価器の動作をフックする手続き trace_func を評価します。
...評価器の動作をフックする手続き trace_func を評価します。... -
Tracer
# trace _ func(event , file , line , id , binding , klass , *) -> object | nil (27201.0) -
@todo
@todo -
Tracer
. trace _ func(*vars) -> object | nil (27201.0) -
debug ライブラリの内部で使用します。
debug ライブラリの内部で使用します。 -
IRB
:: Frame # trace _ func(event , file , line , id , binding) -> Binding (24201.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。 -
Kernel
. # set _ trace _ func(proc) -> Proc (12325.0) -
Ruby インタプリタのイベントをトレースする Proc オブジェクトとして 指定された proc を登録します。 nil を指定するとトレースがオフになります。
...Ruby インタプリタのイベントをトレースする Proc オブジェクトとして
指定された proc を登録します。 nil を指定するとトレースがオフになります。
Ruby インタプリタがプログラムを実行する過程で、メソッドの呼び出しや......された Proc オブジェクトを実行します。
標準添付の debug、tracer、
profile はこの組み込み関数を利用して実現されています。
=== ブロックパラメータの意味
渡す Proc オブジェクトのパラメータは
//emlist[][ruby]{
proc{|event, file,......を表す
Class オブジェクト。トップレベルでは nil。
//}
@param proc トレース用 Proc オブジェクトを指定します。nil を指定した場合、トレースをオフにします。
@return proc を返します。
//emlist[例][ruby]{
set_trace_func lambda {|*ar... -
Thread
# set _ trace _ func(pr) -> Proc | nil (12285.0) -
スレッドにトレース用ハンドラを設定します。
...w do
class Trace
end
2.to_s
Thread.current.set_trace_func nil
3.to_s
end
th.set_trace_func lambda {|*arg| p arg }
th.join
# => ["line", "example.rb", 2, nil, #<Binding:0x00007fc8de87cb08>, nil]
# => ["c-call", "example.rb", 2, :inherited, #<Binding:0x00007fc8de886770>, Class]
# => ["c-ret......07fc8de8844e8>, Class]
# => ["class", "example.rb", 2, nil, #<Binding:0x00007fc8de88e830>, nil]
# => ["end", "example.rb", 3, nil, #<Binding:0x00007fc8de88d6b0>, nil]
# => ["line", "example.rb", 4, nil, #<Binding:0x00007fc8de88c440>, nil]
# => ["c-call", "example.rb", 4, :to_s, #<Binding:0x00007fc8d......> ["c-return", "example.rb", 4, :to_s, #<Binding:0x00007fc8de894a50>, Integer]
# => ["line", "example.rb", 5, nil, #<Binding:0x00007fc8de967b08>, nil]
# => ["c-call", "example.rb", 5, :current, #<Binding:0x00007fc8de967798>, Thread]
# => ["c-return", "example.rb", 5, :current, #<Binding:0x00007fc8de... -
Thread
# add _ trace _ func(pr) -> Proc (12249.0) -
スレッドにトレース用ハンドラを追加します。
...roc オブジェクト)
//emlist[例][ruby]{
th = Thread.new do
class Trace
end
43.to_s
end
th.add_trace_func lambda {|*arg| p arg }
th.join
# => ["line", "example.rb", 4, nil, #<Binding:0x00007f98e107d0d8>, nil]
# => ["c-call", "example.rb", 4, :inherited, #<Binding:0x00007f98e1087448>, Cla......ss]
# => ["c-return", "example.rb", 4, :inherited, #<Binding:0x00007f98e1085d00>, Class]
# => ["class", "example.rb", 4, nil, #<Binding:0x00007f98e108f210>, nil]
# => ["end", "example.rb", 5, nil, #<Binding:0x00007f98e108e5e0>, nil]
# => ["line", "example.rb", 6, nil, #<Binding:0x00007f98e108d4b0>,......nil]
# => ["c-call", "example.rb", 6, :to_s, #<Binding:0x00007f98e1097aa0>, Integer]
# => ["c-return", "example.rb", 6, :to_s, #<Binding:0x00007f98e1095cc8>, Integer]
//}
@see Thread#set_trace_func Kernel.#set_trace_func... -
static VALUE set
_ trace _ func(VALUE obj , VALUE trace) (12216.0) -
Kernel#set_trace_func の実体。 評価器に対するフック手続きを登録します。
...Kernel#set_trace_func の実体。
評価器に対するフック手続きを登録します。... -
TracePoint
# defined _ class -> Class | module (6266.0) -
メソッドを定義したクラスかモジュールを返します。
...ジュールを返します。
//emlist[例][ruby]{
class C; def foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => C
end.enable do
C.new.foo
end
//}
メソッドがモジュールで定義されていた場合も(include に関係なく)モジュー
ルを返します......foo; end; end
class C; include M; end;
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => M
end.enable do
C.new.foo
end
//}
[注意] 特異メソッドを実行した場合は TracePoint#defined_class は特異クラ
スを返します。また、Kernel.#set_trace_func の 6 番目......はなく元のクラスを返します。
//emlist[例][ruby]{
class C; def self.foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => #<Class:C>
end.enable do
C.foo
end
//}
Kernel.#set_trace_func と TracePoint の上記の差分に注意して
ください。
@see 508...