132件ヒット
[1-100件を表示]
(0.171秒)
クラス
- Object (11)
-
RubyVM
:: InstructionSequence (22) - Thread (22)
モジュール
- Kernel (66)
キーワード
-
$ -d (11) -
$ DEBUG (11) - DEBUG= (11)
-
SCRIPT
_ LINES _ _ (11) - Thread (11)
- caller (33)
-
compile
_ option (11) -
compile
_ option= (11) -
set
_ trace _ func (11)
検索結果
先頭5件
-
Thread
. DEBUG -> Integer (32221.0) -
スレッドのデバッグレベルを返します。
...れ以外の場合は、スレッドのデバッグログを標準出力に出力します。
初期値は 0 です。
使用するためには、THREAD_DEBUG を -1 にして Ruby をコンパイルする必要が
あります。
//emlist[例][ruby]{
Thread.DEBUG # => 0
//}
@see Thread.DEBUG=... -
Thread
. DEBUG=(val) (20233.0) -
スレッドのデバッグレベルを val に設定します。
...teger に変換してから設定します。
偽 のときは 0 を設定します。
使用するためには、THREAD_DEBUG を -1 にして Ruby をコンパイルする必要が
あります。
//emlist[例][ruby]{
Thread.DEBUG # => 0
Thread.DEBUG = 1
Thread.DEBUG # => 1
//}
@see Thread.DEBUG... -
Kernel
$ $ DEBUG -> bool (17203.0) -
この値が真のときはインタプリタがデバッグモードになります。
...うになります。
Thread.abort_on_exception を
true にセットするのと同じ効果です。
* Thread.abort_on_exception= の効果がなくなります。
* 例外を捕捉しているかどうかに関係なく、
例外が発生した時点で $stderr にそれが出力され......ます。
スクリプトの処理は続行されます。
この変数はグローバルスコープです。
@see spec/rubycmd... -
Kernel
. # caller(range) -> [String] | nil (17150.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...す。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した値が範囲外の場合は nil を返します。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得す......m 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
def bar
foo
end
ba......ler の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(caller... -
Kernel
. # caller(start = 1) -> [String] | nil (17150.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...す。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した値が範囲外の場合は nil を返します。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得す......m 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
def bar
foo
end
ba......ler の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(caller... -
Kernel
. # caller(start , length) -> [String] | nil (17150.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...す。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した値が範囲外の場合は nil を返します。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得す......m 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
def bar
foo
end
ba......ler の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。
//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(caller... -
Kernel
. # set _ trace _ func(proc) -> Proc (14114.0) -
Ruby インタプリタのイベントをトレースする Proc オブジェクトとして 指定された proc を登録します。 nil を指定するとトレースがオフになります。
...行します。
標準添付の debug、tracer、
profile はこの組み込み関数を利用して実現されています。
=== ブロックパラメータの意味
渡す Proc オブジェクトのパラメータは
//emlist[][ruby]{
proc{|event, file, line, id, binding, klass| "..." }
//}......: event
実行のタイプを表す、以下のいずれかの文字列。
//emlist{
"line": 式の評価。
"call": メソッドの呼び出し。
"return": メソッド呼び出しからのリターン。
"c-call": Cで記述されたメソッドの呼び出し。
"c-ret......end": クラス定義、特異クラス定義、モジュール定義の終了。
"raise": 例外の発生。
//}
: file
実行中のプログラムのソースファイル名 (文字列)。
: line
実行中のプログラムのソースファイル上の行番号 (整数)。
: id
e... -
RubyVM
:: InstructionSequence . compile _ option -> Hash (14114.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。
...す。
//emlist[例][ruby]{
require "pp"
pp RubyVM::InstructionSequence.compile_option
# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_cac......hing=>false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}
@see RubyVM::InstructionSequence.compile_option=... -
Object
:: SCRIPT _ LINES _ _ -> Hash (14108.0) -
ソースファイル別にまとめられたソースコードの各行。
...ガ (debug) などで利用されています。
なお、 $SAFE レベルが 0 でなければ有効にはなりません。
また、 Kernel.#eval によるコンパイルは対象にはなりません。
例:
require 'pp'
SCRIPT_LINES__ = {}
require 'English'
pp SCRIPT_LINES__......by/1.6/English.rb"=>
# ["alias $ERROR_INFO $!\n",
# "alias $ERROR_POSITION $@\n",
# "alias $LOADED_FEATURES $\"\n",
# :
# :
# "alias $POSTMATCH $'\n",
# "alias $LAST_PAREN_MATC... -
RubyVM
:: InstructionSequence . compile _ option=(options) (14108.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを引数 options で指定します。
...ram options コンパイル時の最適化オプションを true、false、nil、
Hash のいずれかで指定します。true を指定した場合は
全てのオプションを有効にします。false を指定した場合は全
てのオプショ......rue か false を指定する事で個
別に有効、無効を指定します。
//emlist{
* :inline_const_cache
* :instructions_unification
* :operands_unification
* :peephole_optimization
* :specialized_instruction
* :stack_caching
* :tailcall_optimization
* :trace_......:debug_level をキーに指定した場合は値を数値で指定します。
.new、.compile、.compile_file メソッドの実行の際に option 引数を指定し
た場合はその実行のみ最適化オプションを変更する事もできます。
@see RubyVM::InstructionSequence.new,...