88件ヒット
[1-88件を表示]
(0.279秒)
種類
- モジュール関数 (44)
- インスタンスメソッド (33)
- クラス (11)
クラス
- Thread (22)
- TracePoint (11)
モジュール
- Kernel (44)
キーワード
- TracePoint (11)
-
add
_ trace _ func (11) - caller (33)
-
defined
_ class (11)
検索結果
先頭5件
-
Kernel
. # set _ trace _ func(proc) -> Proc (27127.0) -
Ruby インタプリタのイベントをトレースする Proc オブジェクトとして 指定された proc を登録します。 nil を指定するとトレースがオフになります。
...オフにします。
@return proc を返します。
//emlist[例][ruby]{
set_trace_func lambda {|*arg|
p arg
}
class Foo
end
43.to_s
# ----結果----
# ["c-return", "..", 1, :set_trace_func, #<Binding:0xf6ceb8>, Kernel]
# ["line", "..", 4, nil, #<Binding:0x10cbcd8>, nil]
# ["c-call", "..", 4,......["class", "..", 4, nil, #<Binding:0x10cb600>, nil]
# ["end", "..", 5, nil, #<Binding:0x10cb3f0>, nil]
# ["line", "..", 6, nil, #<Binding:0x10cb1e0>, nil]
# ["c-call", "..", 6, :to_s, #<Binding:0x10cafd0>, Fixnum]
# ["c-return", "..", 6, :to_s, #<Binding:0x10cad78>, Fixnum]
//}
@see Kernel.#caller... -
Thread
# set _ trace _ func(pr) -> Proc | nil (18133.0) -
スレッドにトレース用ハンドラを設定します。
...したハンドラを返します。
//emlist[例][ruby]{
th = Thread.new 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", "examp......"c-return", "example.rb", 5, :current, #<Binding:0x00007fc8de9673b0>, Thread]
# => ["c-call", "example.rb", 5, :set_trace_func, #<Binding:0x00007fc8de966fc8>, Thread]
//}
@param pr トレースハンドラ(Proc オブジェクト) もしくは nil
@see Thread#add_trace_func Kernel.#set_trace_func... -
Kernel
. # caller(range) -> [String] | nil (9026.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
de... -
Kernel
. # caller(start = 1) -> [String] | nil (9026.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
de... -
Kernel
. # caller(start , length) -> [String] | nil (9026.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...します。
@param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
de... -
TracePoint (34.0)
-
Kernel.#set_trace_func と同様の機能をオブジェクト指向的な API で 提供するクラスです。
...Kernel.#set_trace_func と同様の機能をオブジェクト指向的な API で
提供するクラスです。
//emlist[例:例外に関する情報を収集する][ruby]{
trace = TracePoint.new(:raise) do |tp|
p [tp.lineno, tp.event, tp.raised_exception]
end
# => #<TracePoint:0x007f786a452448... -
TracePoint
# defined _ class -> Class | module (26.0) -
メソッドを定義したクラスかモジュールを返します。
...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.#se... -
Thread
# add _ trace _ func(pr) -> Proc (20.0) -
スレッドにトレース用ハンドラを追加します。
...e0>, 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...