るりまサーチ

最速Rubyリファレンスマニュアル検索!
260件ヒット [201-260件を表示] (0.071秒)

別のキーワード

  1. _builtin binding
  2. proc binding
  3. binding eval
  4. kernel binding
  5. tracepoint binding

ライブラリ

クラス

モジュール

検索結果

<< < 1 2 3 >>

Thread#add_trace_func(pr) -> Proc (49.0)

スレッドにトレース用ハンドラを追加します。

..., "example.rb", 4, nil, #<Binding:0x00007f98e107d0d8>, nil]
# => ["c-call", "example.rb", 4, :inherited, #<Binding:0x00007f98e1087448>, Class]
# => ["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]...

Kernel#xmp(exps, bind = nil) -> XMP (19.0)

引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行 ごとに交互に表示します。

...ます。

@param bind Binding オブジェクトを指定します。省略した場合は、最
後に実行した XMP#puts、Kernel#xmp の
Binding
を使用します。まだ何も実行していない場合は
Object::TOPLEVEL_BINDING を使用します。...

TracePoint#self -> object (19.0)

イベントを発生させたオブジェクトを返します。

...イベントを発生させたオブジェクトを返します。

以下のようにする事で同じ値を取得できます。


//emlist[例][ruby]{
trace.binding.eval('self')
//}

@see TracePoint#binding...
...返します。

以下のようにする事で同じ値を取得できます。

なお、self メソッドは binding が nil になる :c_call および :c_return イベントに対しても正しく動作します。

//emlist[例][ruby]{
trace.binding.eval('self')
//}

@see TracePoint#binding...

Thread#backtrace -> [String] | nil (7.0)

スレッドの現在のバックトレースを返します。

...def m1
sleep 5
end
def m2
m1
end
end

th = Thread.new {C1.new.m2; Thread.stop}
th.backtrace
# => [
# [0] "(irb):3:in `sleep'",
# [1] "(irb):3:in `m1'",
# [2] "(irb):6:in `m2'",
# [3] "(irb):10:in `block in irb_binding'"
# ]

th.kill
th.backtrace # => nil
//}...

Thread#report_on_exception -> bool (7.0)

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...8c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run #...

絞り込み条件を変える

Thread#report_on_exception=(newstate) (7.0)

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...8c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run #...
<< < 1 2 3 >>